Advertisement
Guest User

Untitled

a guest
Feb 16th, 2020
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.63 KB | None | 0 0
  1. ngk=> EXPLAIN (ANALYZE, COSTS, BUFFERS) SELECT comments.comment_id AS comments_comment_id, comments.comment_id_xyz AS comments_comment_id_xyz, comments.post_id AS comments_post_id, comments.parent_id AS comments_parent_id, comments.user_id AS comments_user_id, comments.text AS comments_text, comments.text_tsv AS comments_text_tsv, comments.posted AS comments_posted, comments.vote_plus AS comments_vote_plus, comments.vote_minus AS comments_vote_minus, comments.rating AS comments_rating, comments.source AS comments_source, users_1.user_id AS users_1_user_id, users_1.name AS users_1_name, users_1.avatar_hash AS users_1_avatar_hash, users_1.source AS users_1_source, posts_1.post_id AS posts_1_post_id, posts_1.comment_list_id AS posts_1_comment_list_id, posts_1.user_id AS posts_1_user_id, posts_1.language AS posts_1_language, posts_1.code AS posts_1_code, posts_1.text AS posts_1_text, posts_1.text_tsv AS posts_1_text_tsv, posts_1.posted AS posts_1_posted, posts_1.vote_plus AS posts_1_vote_plus, posts_1.vote_minus AS posts_1_vote_minus, posts_1.rating AS posts_1_rating, posts_1.source AS posts_1_source, users_2.user_id AS users_2_user_id, users_2.name AS users_2_name, users_2.avatar_hash AS users_2_avatar_hash, users_2.source AS users_2_source
  2. ngk-> FROM comments LEFT OUTER JOIN posts AS posts_1 ON posts_1.post_id = comments.post_id LEFT OUTER JOIN users AS users_1 ON users_1.user_id = posts_1.user_id LEFT OUTER JOIN users AS users_2 ON users_2.user_id = comments.user_id WHERE comments.text_tsv @@ plainto_tsquery('russian', 'какой багор') ORDER BY comments.posted DESC LIMIT 20;
  3. QUERY PLAN
  4. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
  5. Limit (cost=1.27..1192.72 rows=20 width=1317) (actual time=0.057..3.087 rows=20 loops=1)
  6. Buffers: shared hit=787 read=145
  7. -> Nested Loop Left Join (cost=1.27..129392.11 rows=2172 width=1317) (actual time=0.057..3.080 rows=20 loops=1)
  8. Buffers: shared hit=787 read=145
  9. -> Nested Loop Left Join (cost=0.99..128328.51 rows=2172 width=1268) (actual time=0.054..2.835 rows=20 loops=1)
  10. Buffers: shared hit=728 read=144
  11. -> Nested Loop Left Join (cost=0.71..127637.16 rows=2172 width=1219) (actual time=0.050..2.429 rows=20 loops=1)
  12. Buffers: shared hit=670 read=142
  13. -> Index Scan Backward using comments_posted on comments (cost=0.42..120830.70 rows=2172 width=453) (actual time=0.045..2.300 rows=20 loops=1)
  14. Filter: (text_tsv @@ '''багор'''::tsquery)
  15. Rows Removed by Filter: 1492
  16. Buffers: shared hit=610 read=142
  17. -> Index Scan using posts_post_ids on posts posts_1 (cost=0.29..3.13 rows=1 width=766) (actual time=0.003..0.003 rows=1 loops=20)
  18. Index Cond: (post_id = comments.post_id)
  19. Buffers: shared hit=60
  20. -> Index Scan using users_user_ids on users users_1 (cost=0.28..0.32 rows=1 width=49) (actual time=0.019..0.019 rows=1 loops=20)
  21. Index Cond: (user_id = posts_1.user_id)
  22. Buffers: shared hit=58 read=2
  23. -> Index Scan using users_user_ids on users users_2 (cost=0.28..0.49 rows=1 width=49) (actual time=0.011..0.011 rows=1 loops=20)
  24. Index Cond: (user_id = comments.user_id)
  25. Buffers: shared hit=59 read=1
  26. Planning Time: 6.972 ms
  27. Execution Time: 3.134 ms
  28. (23 rows)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement