Advertisement
Guest User

Untitled

a guest
Feb 11th, 2015
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 200 RECORDS
  2.  
  3. count_test=# SELECT COUNT(*) FROM posts;
  4. count
  5. -------
  6. 200
  7. (1 row)
  8.  
  9. Time: 2.756 ms
  10.  
  11. count_test=# SELECT COUNT(*) FROM posts WHERE topic = 1;
  12. count
  13. -------
  14. 18
  15. (1 row)
  16.  
  17. Time: 0.552 ms
  18.  
  19. count_test=# SELECT post_count FROM topics WHERE id = 1;
  20. post_count
  21. ------------
  22. 18
  23. (1 row)
  24.  
  25. Time: 0.727 ms
  26.  
  27.  
  28.  
  29.  
  30. LOTS OF RECORDS
  31.  
  32. count_test=# SELECT COUNT(*) FROM posts;
  33. count
  34. --------
  35. 267055
  36. (1 row)
  37.  
  38. Time: 40.096 ms
  39.  
  40. count_test=# SELECT COUNT(*) FROM posts WHERE topic = 1;
  41. count
  42. -------
  43. 26929
  44. (1 row)
  45.  
  46. Time: 58.331 ms
  47.  
  48. count_test=# SELECT post_count FROM topics WHERE id = 1;
  49. post_count
  50. ------------
  51. (0 rows)
  52.  
  53. Time: 0.438 ms
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement