explain.depesz.com

PostgreSQL's explain analyze made readable

Result: EhrP

Settings
# exclusive inclusive rows x rows loops node
1. 0.037 11,684.273 ↓ 2.5 25 1

Limit (cost=164,817.95..164,817.98 rows=10 width=1,002) (actual time=11,684.228..11,684.273 rows=25 loops=1)

2. 26.873 11,684.236 ↓ 2.5 25 1

Sort (cost=164,817.95..164,817.98 rows=10 width=1,002) (actual time=11,684.222..11,684.236 rows=25 loops=1)

  • Sort Key: feedback_customer_feedback.id DESC
  • Sort Method: top-N heapsort Memory: 52kB
3. 5,099.159 11,657.363 ↓ 1,413.5 14,135 1

Nested Loop (cost=13,425.13..164,817.79 rows=10 width=1,002) (actual time=5,484.857..11,657.363 rows=14,135 loops=1)

  • Join Filter: (essays_order.type_of_work_id = essays_typeofwork.id)
  • Rows Removed by Join Filter: 8014545
4. 2.916 2.916 ↑ 1.1 568 1

Seq Scan on essays_typeofwork (cost=0.00..13.12 rows=612 width=51) (actual time=0.042..2.916 rows=568 loops=1)

5. 1,171.883 6,555.288 ↓ 1,413.5 14,135 568

Materialize (cost=13,425.13..164,712.89 rows=10 width=947) (actual time=6.022..11.541 rows=14,135 loops=568)

6. 1,644.017 5,383.405 ↓ 1,413.5 14,135 1

Nested Loop (cost=13,425.13..164,712.84 rows=10 width=947) (actual time=3,419.841..5,383.405 rows=14,135 loops=1)

  • Join Filter: (essays_order.level_work_id = essays_levelwork.id)
  • Rows Removed by Join Filter: 2417085
7. 0.796 0.796 ↓ 1.2 172 1

Seq Scan on essays_levelwork (cost=0.00..3.41 rows=141 width=37) (actual time=0.028..0.796 rows=172 loops=1)

8. 413.490 3,738.592 ↓ 1,413.5 14,135 172

Materialize (cost=13,425.13..164,688.31 rows=10 width=910) (actual time=1.850..21.736 rows=14,135 loops=172)

9. 68.386 3,325.102 ↓ 1,413.5 14,135 1

Hash Semi Join (cost=13,425.13..164,688.26 rows=10 width=910) (actual time=318.043..3,325.102 rows=14,135 loops=1)

  • Hash Cond: (feedback_customer_feedback.id = "ANY_subquery".id)
10. 63.568 3,120.344 ↓ 2.5 67,769 1

Hash Join (cost=7,099.04..158,290.23 rows=27,364 width=910) (actual time=181.160..3,120.344 rows=67,769 loops=1)

  • Hash Cond: (essays_order.paper_subject_id = essays_papersubject.id)
11. 69.839 3,056.354 ↓ 2.5 67,769 1

Hash Left Join (cost=7,073.40..157,888.33 rows=27,364 width=868) (actual time=180.704..3,056.354 rows=67,769 loops=1)

  • Hash Cond: (customers_customer.country_id = core_country.id)
12. 90.576 2,986.325 ↓ 2.5 67,769 1

Hash Left Join (cost=7,065.00..157,503.68 rows=27,364 width=820) (actual time=180.474..2,986.325 rows=67,769 loops=1)

  • Hash Cond: (writers_writer.id = writers_widget_stats_view.writer_id)
13. 102.845 2,895.007 ↓ 2.5 67,769 1

Hash Left Join (cost=7,022.38..157,350.61 rows=27,364 width=752) (actual time=179.681..2,895.007 rows=67,769 loops=1)

  • Hash Cond: (feedback_customer_feedback.writer_id = writers_writer.id)
14. 68.117 2,745.861 ↓ 2.5 67,769 1

Hash Join (cost=5,060.22..155,012.22 rows=27,364 width=748) (actual time=133.056..2,745.861 rows=67,769 loops=1)

  • Hash Cond: (customers_customer.site_id = core_site.id)
15. 111.632 2,668.922 ↓ 2.0 87,431 1

Nested Loop (cost=4,988.40..154,501.68 rows=44,018 width=748) (actual time=124.025..2,668.922 rows=87,431 loops=1)

16. 1,297.896 1,682.980 ↓ 2.0 87,431 1

Hash Join (cost=4,987.97..110,031.09 rows=44,018 width=481) (actual time=124.000..1,682.980 rows=87,431 loops=1)

  • Hash Cond: (essays_order.id = feedback_customer_feedback.order_id)
  • Join Filter: (NOT (hashed SubPlan 1))
17. 261.852 261.852 ↓ 1.0 1,452,412 1

Seq Scan on essays_order (cost=0.00..78,578.70 rows=1,449,370 width=374) (actual time=0.013..261.852 rows=1,452,412 loops=1)

18. 69.617 123.217 ↑ 1.0 87,431 1

Hash (cost=3,879.23..3,879.23 rows=88,035 width=107) (actual time=123.217..123.217 rows=87,431 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 11165kB
19. 53.600 53.600 ↑ 1.0 87,431 1

Seq Scan on feedback_customer_feedback (cost=0.00..3,879.23 rows=88,035 width=107) (actual time=0.027..53.600 rows=87,431 loops=1)

  • Filter: ((paper_rating > 8) AND (paper_rating <= 10))
  • Rows Removed by Filter: 29436
20.          

SubPlan (forHash Join)

21. 0.015 0.015 ↓ 0.0 0 1

Index Scan using customers_writer_blacklist_customer_id_idx on customers_writer_blacklist u0_1 (cost=0.28..8.30 rows=1 width=4) (actual time=0.015..0.015 rows=0 loops=1)

  • Index Cond: (customer_id = 617936)
  • Filter: is_active
22. 874.310 874.310 ↑ 1.0 1 87,431

Index Scan using customers_customer_pkey on customers_customer (cost=0.42..1.00 rows=1 width=267) (actual time=0.010..0.010 rows=1 loops=87,431)

  • Index Cond: (id = essays_order.customer_id)
23. 0.211 8.822 ↑ 1.1 985 1

Hash (cost=58.48..58.48 rows=1,068 width=4) (actual time=8.821..8.822 rows=985 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 51kB
24. 8.611 8.611 ↑ 1.1 985 1

Seq Scan on core_site (cost=0.00..58.48 rows=1,068 width=4) (actual time=0.022..8.611 rows=985 loops=1)

  • Filter: (region_id = 2)
  • Rows Removed by Filter: 752
25. 33.161 46.301 ↓ 1.0 51,124 1

Hash (cost=1,328.58..1,328.58 rows=50,686 width=4) (actual time=46.301..46.301 rows=51,124 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2310kB
26. 13.140 13.140 ↓ 1.0 51,124 1

Index Only Scan using writers_writer_pkey on writers_writer (cost=0.29..1,328.58 rows=50,686 width=4) (actual time=0.020..13.140 rows=51,124 loops=1)

  • Heap Fetches: 36
27. 0.429 0.742 ↑ 1.0 1,450 1

Hash (cost=24.50..24.50 rows=1,450 width=76) (actual time=0.742..0.742 rows=1,450 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 99kB
28. 0.313 0.313 ↑ 1.0 1,450 1

Seq Scan on writers_widget_stats_view (cost=0.00..24.50 rows=1,450 width=76) (actual time=0.025..0.313 rows=1,450 loops=1)

29. 0.091 0.190 ↓ 1.0 241 1

Hash (cost=5.40..5.40 rows=240 width=48) (actual time=0.190..0.190 rows=241 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 28kB
30. 0.099 0.099 ↓ 1.0 241 1

Seq Scan on core_country (cost=0.00..5.40 rows=240 width=48) (actual time=0.025..0.099 rows=241 loops=1)

31. 0.190 0.422 ↓ 1.0 785 1

Hash (cost=15.84..15.84 rows=784 width=42) (actual time=0.422..0.422 rows=785 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 67kB
32. 0.232 0.232 ↓ 1.0 785 1

Seq Scan on essays_papersubject (cost=0.00..15.84 rows=784 width=42) (actual time=0.036..0.232 rows=785 loops=1)

33. 2.690 136.372 ↓ 385.0 16,553 1

Hash (cost=6,325.55..6,325.55 rows=43 width=8) (actual time=136.371..136.372 rows=16,553 loops=1)

  • Buckets: 32768 (originally 1024) Batches: 1 (originally 1) Memory Usage: 903kB
34. 1.812 133.682 ↓ 385.0 16,553 1

Subquery Scan on ANY_subquery (cost=6,324.91..6,325.55 rows=43 width=8) (actual time=127.263..133.682 rows=16,553 loops=1)

35. 2.265 131.870 ↓ 385.0 16,553 1

Unique (cost=6,324.91..6,325.12 rows=43 width=24) (actual time=127.262..131.870 rows=16,553 loops=1)

36. 19.517 129.605 ↓ 385.4 16,574 1

Sort (cost=6,324.91..6,325.01 rows=43 width=24) (actual time=127.259..129.605 rows=16,574 loops=1)

  • Sort Key: u0.order_id, u0.approve_date DESC
  • Sort Method: quicksort Memory: 2063kB
37. 5.273 110.088 ↓ 385.4 16,574 1

Hash Join (cost=3,946.84..6,323.74 rows=43 width=24) (actual time=87.769..110.088 rows=16,574 loops=1)

  • Hash Cond: (u0.writer_id = u6.id)
38. 17.420 43.789 ↓ 2.2 18,969 1

Bitmap Heap Scan on feedback_customer_feedback u0 (cost=377.68..2,721.48 rows=8,711 width=28) (actual time=26.693..43.789 rows=18,969 loops=1)

  • Filter: ((NOT is_deleted) AND is_approved AND is_shareable AND ((comment)::text <> ''::text))
  • Rows Removed by Filter: 67
  • Heap Blocks: exact=1745
39. 26.369 26.369 ↑ 1.1 19,037 1

Bitmap Index Scan on feedback_is_shareable__idx (cost=0.00..375.50 rows=20,144 width=0) (actual time=26.369..26.369 rows=19,037 loops=1)

  • Index Cond: (is_shareable = true)
40. 0.513 61.026 ↓ 5.7 1,450 1

Hash (cost=3,566.01..3,566.01 rows=253 width=4) (actual time=61.026..61.026 rows=1,450 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 67kB
41. 60.513 60.513 ↓ 5.7 1,450 1

Seq Scan on writers_writer u6 (cost=0.00..3,566.01 rows=253 width=4) (actual time=0.140..60.513 rows=1,450 loops=1)

  • Filter: ((status)::text ~~ 'active:%'::text)
  • Rows Removed by Filter: 49674
Planning time : 17.669 ms
Execution time : 11,689.608 ms