Advertisement
mrechte

Untitled

Nov 16th, 2022
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. rechte=> explain (analyze, buffers) SELECT count(*)
  2. FROM t_demo
  3. WHERE id_sorted BETWEEN 10000 AND 20000
  4. mrechte-> ;
  5. QUERY PLAN
  6. ------------------------------------------------------------------------------------------------------------------------------------
  7. Aggregate (cost=348.77..348.78 rows=1 width=8) (actual time=0.934..0.935 rows=1 loops=1)
  8. Buffers: shared hit=6 read=28
  9. -> Index Only Scan using idx_id on t_demo (cost=0.43..322.95 rows=10326 width=0) (actual time=0.017..0.640 rows=10001 loops=1)
  10. Index Cond: ((id_sorted >= 10000) AND (id_sorted <= 20000))
  11. Heap Fetches: 0
  12. Buffers: shared hit=6 read=28
  13. Planning:
  14. Buffers: shared hit=37 read=4
  15. Planning Time: 0.131 ms
  16. Execution Time: 0.948 ms
  17. (10 lignes)
  18.  
  19. mrechte=> explain (analyze, buffers) SELECT count(*)
  20. FROM t_demo
  21. WHERE id_random BETWEEN 10000 AND 10000000;
  22. QUERY PLAN
  23.  
  24. ------------------------------------------------------------------------------------------------------------------------------------
  25. ----
  26. Aggregate (cost=408.98..408.99 rows=1 width=8) (actual time=1.137..1.137 rows=1 loops=1)
  27. Buffers: shared hit=36
  28. -> Index Only Scan using idx_random on t_demo (cost=0.43..378.69 rows=12113 width=0) (actual time=0.020..0.760 rows=11699 loops
  29. =1)
  30. Index Cond: ((id_random >= 10000) AND (id_random <= 10000000))
  31. Heap Fetches: 0
  32. Buffers: shared hit=36
  33. Planning Time: 0.061 ms
  34. Execution Time: 1.154 ms
  35. (8 lignes)
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement