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

catmaid / CATMAID / 6167 / 1
45%
master: 45%

Build:
Build:
LAST BUILD BRANCH: dev
DEFAULT BRANCH: master
Ran 17 Jul 2019 03:50PM UTC
Files 100
Run time 11s
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

17 Jul 2019 03:28PM UTC coverage: 44.508%. Remained the same
6167.1

push

travis-ci

tomka
Add BRIN index to the execution_time column of the transaction log

Since this table keeps track of all transactions to provide additional
semantics, it is rather large on big instances. The execution time
column is constantly increasing and typically part of queries. A BRIN
index is therefore a good choice: it is very small and fast to update,
if the data it works on is sequential (it stores min/max per page).

As an example, such a BRIN index takes up only 280 kB for 57,997,765
transaction log entries.

Without such an index, queries can take an unreasonable amount of time.
The history view in the front-end does exactly such a query and could
easily occupy a back-end worker for a long time, e.g.:

  SELECT execution_time
  FROM catmaid_transaction_info
  WHERE execution_time >= '2019-07-07T00:00:00+00:00'::timestamptz
  AND execution_time <= '2019-07-18T00:00:00+00:00'::timestamptz
  AND user_id = '304'
  AND project_id = '1'

This index changes the common query plan for this query from

 Index Scan using catmaid_transaction_info_pk on catmaid_transaction_info  (cost=0.56..1031296.76 rows=1 width=8)
   Index Cond: ((execution_time >= '2019-07-06 20:00:00-04'::timestamp with time zone) AND (execution_time <= '2019-07-17 20:00:00-04'::timestamp with time zone))
   Filter: ((user_id = 304) AND (project_id = 1))

to

 Bitmap Heap Scan on catmaid_transaction_info  (cost=59.03..15641.84 rows=1 width=8)
   Recheck Cond: ((execution_time >= '2019-07-06 20:00:00-04'::timestamp with time zone) AND (execution_time <= '2019-07-17 20:00:00-04'::timestamp with time zone))
   Filter: ((user_id = 304) AND (project_id = 1))
   ->  Bitmap Index Scan on catmaid_transaction_info_execution_time_idx  (cost=0.00..59.03 rows=8122 width=0)
         Index Cond: ((execution_time >= '2019-07-06 20:00:00-04'::timestamp with time zone) AND (execution_time <= '2019-07-17 20:00:00-04'::timestamp with time zone))

and saves a lot of time by doing so.

8169 of 18354 relevant lines covered (44.51%)

0.45 hits per line

Source Files on job 6167.1
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 5515
  • Travis Job 6167.1
  • 8494c9fe on github
  • Prev Job for on dev (#6166.1)
  • Next Job for on dev (#6170.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