• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OpenTreeMap / otm-core / 326 / 1
82%
develop: 84%

Build:
Build:
LAST BUILD BRANCH: dependabot/npm_and_yarn/sockjs-0.3.21
DEFAULT BRANCH: develop
Ran 24 Feb 2015 06:29PM UTC
Files 288
Run time 19s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

24 Feb 2015 06:13PM UTC coverage: 81.642% (+0.004%) from 81.638%
326.1

push

travis-ci

jwalgran
Update user audit query to be more efficient

Trying to view user profiles other than your own with a large database
was triggering a 500 response. The root cause was the fact that the ORM
was generating a 2.2MB SQL statement, causing Postgres to choke with a
stack error.

The audit query code in lib/user.py builds up the final QuerySet by
gluing together several small parts. I discovered that the same instance
was being fed into the filter multiple times, causing the ORM to
generate a lot of duplicate clauses, bloating the query. Adding a
``distinct`` took care of that.

The fast majority of users will only edit a single instance, and our
audit table is optimized for filtering by instance ID, so I added an
additional query to fetch the ids of a users edited instances and use
that to limit the scope of the query, rather than limiting it to the
larger list of visible instances.

13929 of 17061 relevant lines covered (81.64%)

0.82 hits per line

Source Files on job 326.1
  • Tree
  • List 0
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 326
  • Travis Job 326.1
  • b24bbc87 on github
  • Prev Job for on feature/jcw/speed-up-user-audit-query (#315.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc