Guest User

Untitled

a guest
Nov 22nd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. select * from metadata where metadata_json @> '{"someBool": true}'
  2. AND stamp >= '01-01-2016' ORDER BY stamp DESC LIMIT 100;
  3.  
  4. QUERY PLAN
  5. ----------------------------------------------------------------------------------------------------------------------------------------------------------
  6. Limit (cost=80598.46..80598.71 rows=100 width=381) (actual time=445064.728..445064.791 rows=100 loops=1)
  7. -> Sort (cost=80598.46..80607.46 rows=3600 width=381) (actual time=445064.724..445064.754 rows=100 loops=1)
  8. Sort Key: stamp DESC
  9. Sort Method: top-N heapsort Memory: 109kB
  10. -> Bitmap Heap Scan on metadata (cost=66591.00..80460.87 rows=3600 width=381) (actual time=2881.164..444283.520 rows=1437024 loops=1)
  11. Recheck Cond: ((metadata_json @> '{"someBool": true}'::jsonb) AND (stamp >= '2016-01-01 00:00:00'::timestamp without time zone))
  12. Heap Blocks: exact=882439
  13. -> BitmapAnd (cost=66591.00..66591.00 rows=3600 width=0) (actual time=2599.415..2599.415 rows=0 loops=1)
  14. -> Bitmap Index Scan on metadata_idx (cost=0.00..260.25 rows=25100 width=0) (actual time=1762.166..1762.166 rows=10041746 loops=1)
  15. Index Cond: (metadata_json @> '{"someBool": true}'::jsonb)
  16. -> Bitmap Index Scan on stamp_idx (cost=0.00..66328.69 rows=3600034 width=0) (actual time=760.136..760.136 rows=3591329 loops=1)
  17. Index Cond: (stamp >= '2016-01-01 00:00:00'::timestamp without time zone)
  18. Planning time: 5.008 ms
  19. Execution time: 445072.043 ms
  20. (14 rows)
Add Comment
Please, Sign In to add comment