Guest User

Untitled

a guest
Jan 16th, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1. checkout=# explain analyze
  2. SELECT * FROM public.carts
  3. ORDER BY id DESC LIMIT 10;
  4. QUERY PLAN
  5. ----------------------------------------------------------------------------------------------------------------------------------------------
  6. Limit (cost=0.43..0.75 rows=10 width=16) (actual time=0.042..0.048 rows=10 loops=1)
  7. -> Index Scan Backward using carts_pkey on carts (cost=0.43..313740.34 rows=9999860 width=16) (actual time=0.041..0.044 rows=10 loops=1)
  8. Planning Time: 0.090 ms
  9. Execution Time: 0.066 ms
  10. (4 rows)
  11.  
  12. Time: 0.507 ms
  13.  
  14.  
  15.  
  16. checkout=# explain analyze select * from carts where id=9999990;
  17. QUERY PLAN
  18. -------------------------------------------------------------------------------------------------------------------
  19. Index Scan using carts_pkey on carts (cost=0.43..8.45 rows=1 width=16) (actual time=0.020..0.021 rows=1 loops=1)
  20. Index Cond: (id = 9999990)
  21. Planning Time: 0.102 ms
  22. Execution Time: 0.041 ms
  23. (4 rows)
  24.  
  25. Time: 0.423 ms
  26.  
  27.  
  28. checkout=# explain analyze insert into carts values (10000001, 1301, 482314, 2);
  29. QUERY PLAN
  30. ----------------------------------------------------------------------------------------------
  31. Insert on carts (cost=0.00..0.01 rows=1 width=16) (actual time=0.179..0.179 rows=0 loops=1)
  32. -> Result (cost=0.00..0.01 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=1)
  33. Planning Time: 0.021 ms
  34. Trigger for constraint carts_productID_fkey: time=3.594 calls=1
  35. Execution Time: 3.831 ms
  36. (5 rows)
  37.  
  38. Time: 6.013 ms
  39.  
  40.  
  41. checkout=# explain analyze DELETE from carts where id=9999990
  42. checkout-# ;
  43. QUERY PLAN
  44. ------------------------------------------------------------------------------------------------------------------------
  45. Delete on carts (cost=0.43..8.45 rows=1 width=6) (actual time=1.539..1.539 rows=0 loops=1)
  46. -> Index Scan using carts_pkey on carts (cost=0.43..8.45 rows=1 width=6) (actual time=0.040..0.043 rows=1 loops=1)
  47. Index Cond: (id = 9999990)
  48. Planning Time: 1.796 ms
  49. Execution Time: 1.610 ms
  50. (5 rows)
  51.  
  52. Time: 4.228 ms
  53.  
  54.  
  55. checkout=# explain analyze UPDATE carts SET quantity=10 WHERE id=9999999;
  56. QUERY PLAN
  57. -------------------------------------------------------------------------------------------------------------------------
  58. Update on carts (cost=0.43..8.45 rows=1 width=22) (actual time=0.044..0.044 rows=0 loops=1)
  59. -> Index Scan using carts_pkey on carts (cost=0.43..8.45 rows=1 width=22) (actual time=0.021..0.023 rows=1 loops=1)
  60. Index Cond: (id = 9999999)
  61. Planning Time: 0.100 ms
  62. Execution Time: 0.097 ms
  63. (5 rows)
  64.  
  65. Time: 1.435 ms
Add Comment
Please, Sign In to add comment