Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```sql
- CREATE INDEX ik_oro_message_queue_pi on oro_message_queue (priority DESC, id ASC);
- /*
- Limit (cost=0.42..1.93 rows=10 width=6) (actual time=0.102..0.126 rows=10 loops=1)
- -> Index Scan using ik_oro_message_queue_pi on oro_message_queue (cost=0.42..39594.55 rows=262144 width=6) (actual time=0.100..0.121 rows=10 loops=1)
- Filter: ((consumer_id IS NULL) AND ((delayed_until IS NULL) OR (delayed_until <= 10000000)) AND ((queue)::text = 'oro.default'::text))
- Planning time: 0.538 ms
- Execution time: 0.177 ms
- Limit (cost=23202.00..23202.02 rows=10 width=6) (actual time=122.237..122.238 rows=10 loops=1)
- -> Sort (cost=23202.00..23857.36 rows=262144 width=6) (actual time=122.236..122.237 rows=10 loops=1)
- Sort Key: priority DESC, id
- Sort Method: top-N heapsort Memory: 25kB
- -> Seq Scan on oro_message_queue (cost=0.00..17537.16 rows=262144 width=6) (actual time=0.013..87.115 rows=262144 loops=1)
- Filter: ((consumer_id IS NULL) AND ((delayed_until IS NULL) OR (delayed_until <= 10000000)) AND ((queue)::text = 'oro.default'::text))
- Planning time: 0.290 ms
- Execution time: 122.275 ms
- */
- ```
- | Queue | W/O idx (pri DESC, id ASC) | W/O Prefetch (m/sec.) | Prefetch x2 (m/sec.) | Prefetch x4 (m/sec.)| Prefetch x16 (m/sec.) |
- |-----|:------:|:------:|:------:|:------:|:------:|
- | 100k| 26 | 420 | 880 | 1200 | 1740 |
- | 1MM | 3.2 | 370 | 780 | 1050 | 1590 |
- | 30MM| N/A | 340 | 600 | 900 | 1360 |
Add Comment
Please, Sign In to add comment