explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NUL8

Settings
# exclusive inclusive rows x rows loops node
1. 9.379 72.799 ↑ 1.9 669 1

Sort (cost=95,313.04..95,316.22 rows=1,271 width=2,444) (actual time=72.645..72.799 rows=669 loops=1)

  • Sort Key: o.tag_recommend DESC NULLS LAST, o.order_order_cost DESC
  • Sort Method: quicksort Memory: 1513kB
2. 0.629 63.420 ↑ 1.9 669 1

Nested Loop Left Join (cost=72,912.59..95,247.51 rows=1,271 width=2,444) (actual time=48.908..63.420 rows=669 loops=1)

3. 0.382 56.770 ↑ 1.9 669 1

Hash Left Join (cost=72,912.15..84,638.85 rows=1,271 width=2,420) (actual time=48.896..56.770 rows=669 loops=1)

  • Hash Cond: (o.id_lang_trans = lt.id_lang)
4. 0.512 56.348 ↑ 1.9 669 1

Hash Join (cost=72,909.13..84,630.84 rows=1,271 width=2,395) (actual time=48.847..56.348 rows=669 loops=1)

  • Hash Cond: (o.id_lang = l.id_lang)
5. 0.875 55.796 ↑ 1.9 669 1

Nested Loop (cost=72,906.10..84,610.33 rows=1,271 width=2,370) (actual time=48.798..55.796 rows=669 loops=1)

6. 0.481 50.238 ↑ 1.9 669 1

Hash Join (cost=72,905.67..73,952.85 rows=1,271 width=2,352) (actual time=48.784..50.238 rows=669 loops=1)

  • Hash Cond: (o.id_cat = c.id_cat)
7. 0.994 49.499 ↑ 1.9 669 1

Hash Right Join (cost=72,716.32..73,746.03 rows=1,271 width=2,305) (actual time=48.516..49.499 rows=669 loops=1)

  • Hash Cond: (v.id_post = o.id_post)
8. 0.018 0.018 ↑ 155.0 2 1

Index Scan using pk_blog_post_votes on post_votes v (cost=0.56..1,029.09 rows=310 width=9) (actual time=0.016..0.018 rows=2 loops=1)

  • Index Cond: (id_user = 27241601)
9. 1.289 48.487 ↑ 1.9 669 1

Hash (cost=72,699.87..72,699.87 rows=1,271 width=2,296) (actual time=48.487..48.487 rows=669 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 1117kB
10. 0.922 47.198 ↑ 1.9 669 1

Subquery Scan on o (cost=72,683.99..72,699.87 rows=1,271 width=2,296) (actual time=46.075..47.198 rows=669 loops=1)

11. 9.164 46.276 ↑ 1.9 669 1

Sort (cost=72,683.99..72,687.16 rows=1,271 width=2,232) (actual time=46.072..46.276 rows=669 loops=1)

  • Sort Key: (((sum((t1.p_weight + t2.p_weight))) + ((o_1.order_tag_money_rating * 5))::numeric)) DESC NULLS LAST, o_1.order_order_cost DESC
  • Sort Method: quicksort Memory: 1373kB
12. 1.063 37.112 ↑ 1.9 669 1

Hash Right Join (cost=72,464.71..72,618.45 rows=1,271 width=2,232) (actual time=36.065..37.112 rows=669 loops=1)

  • Hash Cond: (t2.id_order = o_1.id_order)
13. 0.006 0.030 ↓ 0.0 0 1

Sort (cost=1,248.43..1,268.66 rows=8,092 width=24) (actual time=0.030..0.030 rows=0 loops=1)

  • Sort Key: (sum((t1.p_weight + t2.p_weight))) DESC
  • Sort Method: quicksort Memory: 25kB
14. 0.016 0.024 ↓ 0.0 0 1

HashAggregate (cost=622.02..723.17 rows=8,092 width=24) (actual time=0.024..0.024 rows=0 loops=1)

  • Group Key: t2.id_order
15. 0.000 0.008 ↓ 0.0 0 1

Nested Loop (cost=9.08..493.30 rows=17,162 width=24) (actual time=0.008..0.008 rows=0 loops=1)

16. 0.008 0.008 ↓ 0.0 0 1

Index Scan using idx_authors_tags_id_user on authors_tags t1 (cost=0.43..24.17 rows=10 width=28) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: (id_user = 27241601)
17. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on orders_tags t2 (cost=8.65..46.81 rows=10 width=38) (never executed)

  • Recheck Cond: (((p_tag)::text = (t1.p_tag)::text) AND (p_val = t1.p_val))
18. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_orders_tags (cost=0.00..8.64 rows=10 width=0) (never executed)

  • Index Cond: (((p_tag)::text = (t1.p_tag)::text) AND (p_val = t1.p_val))
19. 1.527 36.019 ↑ 1.1 669 1

Hash (cost=71,207.45..71,207.45 rows=706 width=2,200) (actual time=36.019..36.019 rows=669 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1109kB
20. 0.439 34.492 ↑ 1.1 669 1

Nested Loop Anti Join (cost=754.24..71,207.45 rows=706 width=2,200) (actual time=0.161..34.492 rows=669 loops=1)

21. 0.509 30.708 ↑ 1.1 669 1

Hash Anti Join (cost=753.82..68,379.68 rows=713 width=2,200) (actual time=0.151..30.708 rows=669 loops=1)

  • Hash Cond: (o_1.id_order = otb.id_order)
22. 30.122 30.193 ↑ 1.1 669 1

Index Scan using orders_active_order_tag_money_rating_idx1 on orders_active o_1 (cost=7.05..67,615.02 rows=747 width=2,200) (actual time=0.139..30.193 rows=669 loops=1)

  • Index Cond: (order_tag_money_rating > 0)
  • Filter: (is_active AND is_white AND (jobs_can_take > 0) AND ((themes_active AND (themes_jobs_can_take > 0)) OR (NOT themes_active) OR (themes_active IS NULL)) AND ((order (...)
  • Rows Removed by Filter: 191
23.          

SubPlan (forIndex Scan)

24. 0.005 0.005 ↑ 3.0 2 1

Index Only Scan using idx_author_list on white_list (cost=0.42..4.53 rows=6 width=8) (actual time=0.005..0.005 rows=2 loops=1)

  • Index Cond: (id_author = 27241601)
  • Heap Fetches: 0
25. 0.000 0.000 ↓ 0.0 0

Index Scan using tender_requests_id_order_id_author_idx on tender_requests r (cost=0.41..8.44 rows=1 width=0) (never executed)

  • Index Cond: ((id_order = o_1.id_order) AND (id_author = 27241601))
  • Filter: ((date_end > now()) AND (request_state = ANY ('{2,7,6,5,8}'::integer[])))
26. 0.026 0.026 ↓ 0.0 0 1

Index Scan using idx_tender_requests_author on tender_requests r_1 (cost=0.42..20.37 rows=1 width=8) (actual time=0.026..0.026 rows=0 loops=1)

  • Index Cond: (id_author = 27241601)
  • Filter: ((date_end > now()) AND (request_state = ANY ('{2,7,6,5,8}'::integer[])))
  • Rows Removed by Filter: 8
27. 0.000 0.000 ↓ 0.0 0

Index Only Scan using idx_author_list on white_list white_list_1 (cost=0.42..4.44 rows=1 width=0) (never executed)

  • Index Cond: ((id_author = 27241601) AND (id_list = o_1.id_list))
  • Heap Fetches: 0
28. 0.005 0.005 ↑ 3.0 2 1

Index Only Scan using idx_author_list on white_list white_list_2 (cost=0.42..4.53 rows=6 width=8) (actual time=0.005..0.005 rows=2 loops=1)

  • Index Cond: (id_author = 27241601)
  • Heap Fetches: 0
29. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pk_orders_to on orders_to (cost=0.56..8.58 rows=1 width=0) (never executed)

  • Index Cond: ((id_order = o_1.id_order) AND (id_author = 27241601))
  • Heap Fetches: 0
30. 0.008 0.008 ↓ 0.0 0 1

Index Scan using idx_orders_to_author on orders_to orders_to_1 (cost=0.56..2,460.76 rows=1,041 width=8) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: (id_author = 27241601)
31. 0.004 0.004 ↑ 1.0 4 1

Seq Scan on advego_lists (cost=0.00..1.04 rows=4 width=8) (actual time=0.002..0.004 rows=4 loops=1)

32. 0.000 0.000 ↓ 0.0 0

Index Only Scan using idx_author_list on white_list white_list_3 (cost=0.42..4.44 rows=1 width=0) (never executed)

  • Index Cond: ((id_author = 27241601) AND (id_list = o_1.id_list))
  • Heap Fetches: 0
33. 0.008 0.008 ↑ 3.0 2 1

Index Only Scan using idx_author_list on white_list white_list_4 (cost=0.42..4.53 rows=6 width=8) (actual time=0.007..0.008 rows=2 loops=1)

  • Index Cond: (id_author = 27241601)
  • Heap Fetches: 0
34. 0.000 0.000 ↓ 0.0 0

Index Scan using tender_requests_id_order_id_author_idx on tender_requests r_2 (cost=0.41..8.43 rows=1 width=0) (never executed)

  • Index Cond: ((id_order = o_1.id_order) AND (id_author = 27241601))
  • Filter: (request_state = 7)
35. 0.007 0.007 ↓ 0.0 0 1

Index Scan using tender_requests_id_author_request_state_idx on tender_requests r_3 (cost=0.42..8.44 rows=1 width=8) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: ((id_author = 27241601) AND (request_state = 7))
36. 0.000 0.000 ↓ 0.0 0

Index Only Scan using idx_tender_requests_order on tender_requests (cost=0.42..8.49 rows=4 width=0) (never executed)

  • Index Cond: (id_order = o_1.id_order)
  • Heap Fetches: 0
37. 0.000 0.000 ↓ 0.0 0

Seq Scan on tender_requests tender_requests_1 (cost=0.00..11,768.02 rows=249,902 width=8) (never executed)

38. 0.003 0.003 ↑ 1.0 4 1

Seq Scan on advego_lists advego_lists_1 (cost=0.00..1.04 rows=4 width=8) (actual time=0.002..0.003 rows=4 loops=1)

39. 0.000 0.000 ↓ 0.0 0

Index Only Scan using idx_author_list on white_list white_list_5 (cost=0.42..4.44 rows=1 width=0) (never executed)

  • Index Cond: ((id_author = 27241601) AND (id_list = o_1.id_list))
  • Heap Fetches: 0
40. 0.005 0.005 ↑ 3.0 2 1

Index Only Scan using idx_author_list on white_list white_list_6 (cost=0.42..4.53 rows=6 width=8) (actual time=0.004..0.005 rows=2 loops=1)

  • Index Cond: (id_author = 27241601)
  • Heap Fetches: 0
41. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pk_orders_to on orders_to orders_to_2 (cost=0.56..8.58 rows=1 width=0) (never executed)

  • Index Cond: ((id_order = o_1.id_order) AND (id_author = 27241601))
  • Heap Fetches: 0
42. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_orders_to_author on orders_to orders_to_3 (cost=0.56..2,460.76 rows=1,041 width=8) (never executed)

  • Index Cond: (id_author = 27241601)
43. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_tender_requests_order on tender_requests r_4 (cost=4.96..19.40 rows=1 width=0) (never executed)

  • Index Cond: (id_order = o_1.id_order)
  • Filter: ((request_state = 3) AND ((id_list = 0) OR (hashed SubPlan 20)))
44.          

SubPlan (forIndex Scan)

45. 0.000 0.000 ↓ 0.0 0

Index Only Scan using idx_author_list on white_list wl (cost=0.42..4.53 rows=6 width=8) (never executed)

  • Index Cond: (id_author = 27241601)
  • Heap Fetches: 0
46. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on tender_requests r_5 (cost=577.26..10,231.89 rows=12,101 width=8) (never executed)

  • Recheck Cond: (request_state = 3)
  • Filter: ((id_list = 0) OR (hashed SubPlan 22))
47. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on tender_requests_request_state_idx (cost=0.00..569.69 rows=22,036 width=0) (never executed)

  • Index Cond: (request_state = 3)
48.          

SubPlan (forBitmap Heap Scan)

49. 0.000 0.000 ↓ 0.0 0

Index Only Scan using idx_author_list on white_list wl_1 (cost=0.42..4.53 rows=6 width=8) (never executed)

  • Index Cond: (id_author = 27241601)
  • Heap Fetches: 0
50. 0.000 0.006 ↓ 0.0 0 1

Hash (cost=744.18..744.18 rows=207 width=8) (actual time=0.006..0.006 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
51. 0.006 0.006 ↓ 0.0 0 1

Index Scan using idx_orders_to_black_author on orders_to_black otb (cost=0.43..744.18 rows=207 width=8) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: (id_author = 27241601)
52. 3.345 3.345 ↓ 0.0 0 669

Index Only Scan using uq_black_list_author on black_list bl (cost=0.42..3.97 rows=1 width=8) (actual time=0.005..0.005 rows=0 loops=669)

  • Index Cond: ((id_user = o_1.id_user) AND (id_author = 27241601))
  • Heap Fetches: 0
53. 0.019 0.258 ↑ 1.0 60 1

Hash (cost=188.60..188.60 rows=60 width=55) (actual time=0.258..0.258 rows=60 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
54. 0.239 0.239 ↑ 1.0 60 1

Seq Scan on categories c (cost=0.00..188.60 rows=60 width=55) (actual time=0.004..0.239 rows=60 loops=1)

55. 4.683 4.683 ↑ 1.0 1 669

Index Scan using pk_users on users u (cost=0.43..8.38 rows=1 width=26) (actual time=0.004..0.007 rows=1 loops=669)

  • Index Cond: (id_user = o.id_user)
56. 0.021 0.040 ↑ 1.0 90 1

Hash (cost=1.90..1.90 rows=90 width=33) (actual time=0.040..0.040 rows=90 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
57. 0.019 0.019 ↑ 1.0 90 1

Seq Scan on languages l (cost=0.00..1.90 rows=90 width=33) (actual time=0.007..0.019 rows=90 loops=1)

58. 0.024 0.040 ↑ 1.0 90 1

Hash (cost=1.90..1.90 rows=90 width=33) (actual time=0.040..0.040 rows=90 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
59. 0.016 0.016 ↑ 1.0 90 1

Seq Scan on languages lt (cost=0.00..1.90 rows=90 width=33) (actual time=0.006..0.016 rows=90 loops=1)

60. 6.021 6.021 ↑ 1.0 1 669

Index Scan using pk_blog_posts on posts p (cost=0.43..8.34 rows=1 width=32) (actual time=0.004..0.009 rows=1 loops=669)

  • Index Cond: (o.id_post = id_post)