Guest User

Untitled

a guest
Oct 23rd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. ```sql
  2. CREATE INDEX ik_oro_message_queue_pi on oro_message_queue (priority DESC, id ASC);
  3.  
  4. /*
  5. Limit (cost=0.42..1.93 rows=10 width=6) (actual time=0.102..0.126 rows=10 loops=1)
  6. -> 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)
  7. Filter: ((consumer_id IS NULL) AND ((delayed_until IS NULL) OR (delayed_until <= 10000000)) AND ((queue)::text = 'oro.default'::text))
  8. Planning time: 0.538 ms
  9. Execution time: 0.177 ms
  10.  
  11.  
  12. Limit (cost=23202.00..23202.02 rows=10 width=6) (actual time=122.237..122.238 rows=10 loops=1)
  13. -> Sort (cost=23202.00..23857.36 rows=262144 width=6) (actual time=122.236..122.237 rows=10 loops=1)
  14. Sort Key: priority DESC, id
  15. Sort Method: top-N heapsort Memory: 25kB
  16. -> 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)
  17. Filter: ((consumer_id IS NULL) AND ((delayed_until IS NULL) OR (delayed_until <= 10000000)) AND ((queue)::text = 'oro.default'::text))
  18. Planning time: 0.290 ms
  19. Execution time: 122.275 ms
  20. */
  21. ```
  22.  
  23. | 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.) |
  24. |-----|:------:|:------:|:------:|:------:|:------:|
  25. | 100k| 26 | 420 | 880 | 1200 | 1740 |
  26. | 1MM | 3.2 | 370 | 780 | 1050 | 1590 |
  27. | 30MM| N/A | 340 | 600 | 900 | 1360 |
Add Comment
Please, Sign In to add comment