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

OpenTreeMap / otm-core / 315
82%
develop: 84%

Build:
Build:
LAST BUILD BRANCH: dependabot/npm_and_yarn/sockjs-0.3.21
DEFAULT BRANCH: develop
Ran 23 Feb 2015 11:21PM UTC
Jobs 1
Files 288
Run time 18s
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

pending completion
315

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 17062 relevant lines covered (81.64%)

0.82 hits per line

Jobs
ID Job ID Ran Files Coverage
1 315.1 23 Feb 2015 11:21PM UTC 0
81.64
Travis Job 315.1
Source Files on build 315
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #315
  • ce97aeb6 on github
  • Next Build on feature/jcw/speed-up-user-audit-query (#326)
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