explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9e8X

Settings
# exclusive inclusive rows x rows loops node
1. 0.033 11,407.775 ↓ 2.5 25 1

Limit (cost=166,006.20..166,006.23 rows=10 width=1,002) (actual time=11,407.732..11,407.775 rows=25 loops=1)

2. 34.950 11,407.742 ↓ 2.5 25 1

Sort (cost=166,006.20..166,006.23 rows=10 width=1,002) (actual time=11,407.729..11,407.742 rows=25 loops=1)

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

Nested Loop (cost=13,673.53..166,006.04 rows=10 width=1,002) (actual time=4,568.307..11,372.792 rows=14,135 loops=1)

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

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

5. 1,232.318 5,677.160 ↓ 1,413.5 14,135 568

Materialize (cost=13,673.53..165,901.14 rows=10 width=947) (actual time=1.627..9.995 rows=14,135 loops=568)

6. 76.399 4,444.842 ↓ 1,413.5 14,135 1

Hash Semi Join (cost=13,673.53..165,901.09 rows=10 width=947) (actual time=923.788..4,444.842 rows=14,135 loops=1)

  • Hash Cond: (feedback_customer_feedback.id = "ANY_subquery".id)
7. 106.659 3,608.366 ↓ 2.0 87,431 1

Hash Join (cost=7,032.39..159,144.29 rows=44,018 width=947) (actual time=162.041..3,608.366 rows=87,431 loops=1)

  • Hash Cond: (essays_order.level_work_id = essays_levelwork.id)
8. 93.859 3,501.549 ↓ 2.0 87,431 1

Hash Join (cost=7,027.22..158,533.87 rows=44,018 width=910) (actual time=161.840..3,501.549 rows=87,431 loops=1)

  • Hash Cond: (essays_order.paper_subject_id = essays_papersubject.id)
9. 105.539 3,406.951 ↓ 2.0 87,431 1

Hash Left Join (cost=7,001.58..157,902.99 rows=44,018 width=868) (actual time=161.074..3,406.951 rows=87,431 loops=1)

  • Hash Cond: (customers_customer.country_id = core_country.id)
10. 68.459 3,301.184 ↓ 2.0 87,431 1

Nested Loop (cost=6,993.18..157,289.34 rows=44,018 width=820) (actual time=160.790..3,301.184 rows=87,431 loops=1)

11. 89.535 2,008.691 ↓ 2.0 87,431 1

Hash Left Join (cost=6,992.75..112,818.74 rows=44,018 width=553) (actual time=160.724..2,008.691 rows=87,431 loops=1)

  • Hash Cond: (writers_writer.id = writers_widget_stats_view.writer_id)
12. 123.479 1,918.301 ↓ 2.0 87,431 1

Hash Left Join (cost=6,950.13..112,598.46 rows=44,018 width=485) (actual time=159.816..1,918.301 rows=87,431 loops=1)

  • Hash Cond: (feedback_customer_feedback.writer_id = writers_writer.id)
13. 1,293.349 1,766.983 ↓ 2.0 87,431 1

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

  • Hash Cond: (essays_order.id = feedback_customer_feedback.order_id)
  • Join Filter: (NOT (hashed SubPlan 1))
14. 342.971 342.971 ↓ 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.023..342.971 rows=1,452,412 loops=1)

15. 60.657 130.632 ↑ 1.0 87,431 1

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

  • Buckets: 131072 Batches: 1 Memory Usage: 11165kB
16. 69.975 69.975 ↑ 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.035..69.975 rows=87,431 loops=1)

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

SubPlan (forHash Join)

18. 0.031 0.031 ↓ 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.031..0.031 rows=0 loops=1)

  • Index Cond: (customer_id = 617936)
  • Filter: is_active
19. 18.829 27.839 ↓ 1.0 51,124 1

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

  • Buckets: 65536 Batches: 1 Memory Usage: 2310kB
20. 9.010 9.010 ↓ 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.063..9.010 rows=51,124 loops=1)

  • Heap Fetches: 0
21. 0.427 0.855 ↑ 1.0 1,450 1

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

  • Buckets: 2048 Batches: 1 Memory Usage: 99kB
22. 0.428 0.428 ↑ 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.048..0.428 rows=1,450 loops=1)

23. 1,224.034 1,224.034 ↑ 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.013..0.014 rows=1 loops=87,431)

  • Index Cond: (id = essays_order.customer_id)
24. 0.111 0.228 ↓ 1.0 241 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 28kB
25. 0.117 0.117 ↓ 1.0 241 1

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

26. 0.281 0.739 ↓ 1.0 785 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 67kB
27. 0.458 0.458 ↓ 1.0 785 1

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

28. 0.067 0.158 ↓ 1.2 172 1

Hash (cost=3.41..3.41 rows=141 width=37) (actual time=0.158..0.158 rows=172 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
29. 0.091 0.091 ↓ 1.2 172 1

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

30. 3.587 760.077 ↓ 556.4 15,023 1

Hash (cost=6,640.80..6,640.80 rows=27 width=8) (actual time=760.077..760.077 rows=15,023 loops=1)

  • Buckets: 16384 (originally 1024) Batches: 1 (originally 1) Memory Usage: 715kB
31. 1.777 756.490 ↓ 556.4 15,023 1

Subquery Scan on ANY_subquery (cost=6,640.40..6,640.80 rows=27 width=8) (actual time=748.452..756.490 rows=15,023 loops=1)

32. 2.518 754.713 ↓ 556.4 15,023 1

Unique (cost=6,640.40..6,640.53 rows=27 width=24) (actual time=748.448..754.713 rows=15,023 loops=1)

33. 24.766 752.195 ↓ 557.1 15,043 1

Sort (cost=6,640.40..6,640.47 rows=27 width=24) (actual time=748.445..752.195 rows=15,043 loops=1)

  • Sort Key: u0.order_id, u0.approve_date DESC
  • Sort Method: quicksort Memory: 1560kB
34. 11.500 727.429 ↓ 557.1 15,043 1

Nested Loop (cost=3,947.97..6,639.76 rows=27 width=24) (actual time=93.220..727.429 rows=15,043 loops=1)

35. 5.984 649.633 ↓ 385.4 16,574 1

Nested Loop (cost=3,947.69..6,626.51 rows=43 width=28) (actual time=93.179..649.633 rows=16,574 loops=1)

36. 15.531 361.891 ↓ 385.4 16,574 1

Nested Loop (cost=3,947.27..6,583.07 rows=43 width=28) (actual time=93.088..361.891 rows=16,574 loops=1)

37. 19.255 147.472 ↓ 385.4 16,574 1

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

  • Hash Cond: (u0.writer_id = u6.id)
38. 35.567 38.041 ↓ 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=2.779..38.041 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. 2.474 2.474 ↑ 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=2.473..2.474 rows=19,037 loops=1)

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

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

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

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

  • Filter: ((status)::text ~~ 'active:%'::text)
  • Rows Removed by Filter: 49674
42. 198.888 198.888 ↑ 1.0 1 16,574

Index Scan using essays_order_pkey on essays_order u1 (cost=0.43..6.02 rows=1 width=12) (actual time=0.012..0.012 rows=1 loops=16,574)

  • Index Cond: (id = u0.order_id)
43. 281.758 281.758 ↑ 1.0 1 16,574

Index Scan using customers_customer_pkey on customers_customer u2 (cost=0.42..1.00 rows=1 width=12) (actual time=0.016..0.017 rows=1 loops=16,574)

  • Index Cond: (id = u1.customer_id)
44. 66.296 66.296 ↑ 1.0 1 16,574

Index Scan using core_site_pkey on core_site u3 (cost=0.28..0.30 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=16,574)

  • Index Cond: (id = u2.site_id)
  • Filter: (region_id = 2)
  • Rows Removed by Filter: 0
Planning time : 36.775 ms
Execution time : 11,423.443 ms