explain.depesz.com

PostgreSQL's explain analyze made readable

Result: k7fp

Settings
# exclusive inclusive rows x rows loops node
1. 0.021 3,081.846 ↓ 2.5 25 1

Limit (cost=165,601.98..165,602.00 rows=10 width=241) (actual time=3,081.818..3,081.846 rows=25 loops=1)

2. 13.493 3,081.825 ↓ 2.5 25 1

Sort (cost=165,601.98..165,602.00 rows=10 width=241) (actual time=3,081.816..3,081.825 rows=25 loops=1)

  • Sort Key: feedback_customer_feedback.id DESC
  • Sort Method: top-N heapsort Memory: 32kB
3. 5.123 3,068.332 ↓ 1,413.5 14,135 1

Nested Loop (cost=13,371.13..165,601.81 rows=10 width=241) (actual time=287.742..3,068.332 rows=14,135 loops=1)

4. 64.512 3,001.137 ↓ 969.9 15,518 1

Hash Semi Join (cost=13,370.85..165,596.88 rows=16 width=245) (actual time=287.715..3,001.137 rows=15,518 loops=1)

  • Hash Cond: (feedback_customer_feedback.id = "ANY_subquery".id)
5. 80.194 2,795.569 ↓ 2.0 87,431 1

Nested Loop (cost=7,044.76..159,155.07 rows=44,018 width=245) (actual time=145.873..2,795.569 rows=87,431 loops=1)

6. 45.604 1,928.496 ↓ 2.0 87,431 1

Hash Join (cost=7,044.34..114,681.89 rows=44,018 width=241) (actual time=145.831..1,928.496 rows=87,431 loops=1)

  • Hash Cond: (essays_order.type_of_work_id = essays_typeofwork.id)
7. 41.862 1,882.449 ↓ 2.0 87,431 1

Hash Join (cost=7,023.57..114,055.87 rows=44,018 width=217) (actual time=145.351..1,882.449 rows=87,431 loops=1)

  • Hash Cond: (essays_order.level_work_id = essays_levelwork.id)
8. 74.748 1,840.477 ↓ 2.0 87,431 1

Hash Join (cost=7,018.39..113,445.45 rows=44,018 width=203) (actual time=145.222..1,840.477 rows=87,431 loops=1)

  • Hash Cond: (essays_order.paper_subject_id = essays_papersubject.id)
9. 65.341 1,765.293 ↓ 2.0 87,431 1

Hash Left Join (cost=6,992.75..112,814.56 rows=44,018 width=181) (actual time=144.763..1,765.293 rows=87,431 loops=1)

  • Hash Cond: (writers_writer.id = writers_widget_stats_view.writer_id)
10. 126.669 1,699.183 ↓ 2.0 87,431 1

Hash Left Join (cost=6,950.13..112,594.28 rows=44,018 width=113) (actual time=143.942..1,699.183 rows=87,431 loops=1)

  • Hash Cond: (feedback_customer_feedback.writer_id = writers_writer.id)
11. 1,160.606 1,545.874 ↓ 2.0 87,431 1

Hash Join (cost=4,987.97..110,026.91 rows=44,018 width=109) (actual time=116.859..1,545.874 rows=87,431 loops=1)

  • Hash Cond: (essays_order.id = feedback_customer_feedback.order_id)
  • Join Filter: (NOT (hashed SubPlan 1))
12. 269.392 269.392 ↓ 1.0 1,452,413 1

Seq Scan on essays_order (cost=0.00..78,577.18 rows=1,449,218 width=30) (actual time=0.012..269.392 rows=1,452,413 loops=1)

13. 51.235 115.855 ↑ 1.0 87,431 1

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

  • Buckets: 131072 Batches: 1 Memory Usage: 9090kB
14. 64.620 64.620 ↑ 1.0 87,431 1

Seq Scan on feedback_customer_feedback (cost=0.00..3,879.23 rows=88,035 width=79) (actual time=0.032..64.620 rows=87,431 loops=1)

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

SubPlan (forHash Join)

16. 0.021 0.021 ↓ 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.021..0.021 rows=0 loops=1)

  • Index Cond: (customer_id = 617936)
  • Filter: is_active
17. 16.902 26.640 ↓ 1.0 51,124 1

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

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

  • Heap Fetches: 646
19. 0.369 0.769 ↑ 1.0 1,450 1

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

  • Buckets: 2048 Batches: 1 Memory Usage: 101kB
20. 0.400 0.400 ↑ 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.030..0.400 rows=1,450 loops=1)

21. 0.208 0.436 ↓ 1.0 785 1

Hash (cost=15.84..15.84 rows=784 width=22) (actual time=0.436..0.436 rows=785 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 50kB
22. 0.228 0.228 ↓ 1.0 785 1

Seq Scan on essays_papersubject (cost=0.00..15.84 rows=784 width=22) (actual time=0.024..0.228 rows=785 loops=1)

23. 0.049 0.110 ↓ 1.2 172 1

Hash (cost=3.41..3.41 rows=141 width=14) (actual time=0.110..0.110 rows=172 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
24. 0.061 0.061 ↓ 1.2 172 1

Seq Scan on essays_levelwork (cost=0.00..3.41 rows=141 width=14) (actual time=0.029..0.061 rows=172 loops=1)

25. 0.246 0.443 ↑ 1.1 568 1

Hash (cost=13.12..13.12 rows=612 width=24) (actual time=0.443..0.443 rows=568 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 40kB
26. 0.197 0.197 ↑ 1.1 568 1

Seq Scan on essays_typeofwork (cost=0.00..13.12 rows=612 width=24) (actual time=0.046..0.197 rows=568 loops=1)

27. 786.879 786.879 ↑ 1.0 1 87,431

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

  • Index Cond: (id = essays_order.customer_id)
28. 4.891 141.056 ↓ 385.0 16,553 1

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

  • Buckets: 32768 (originally 1024) Batches: 1 (originally 1) Memory Usage: 903kB
29. 2.017 136.165 ↓ 385.0 16,553 1

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

30. 3.656 134.148 ↓ 385.0 16,553 1

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

31. 12.652 130.492 ↓ 385.4 16,574 1

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

  • Sort Key: u0.order_id, u0.approve_date DESC
  • Sort Method: quicksort Memory: 2063kB
32. 7.649 117.840 ↓ 385.4 16,574 1

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

  • Hash Cond: (u0.writer_id = u5.id)
33. 18.618 20.782 ↓ 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.509..20.782 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
34. 2.164 2.164 ↑ 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.164..2.164 rows=19,037 loops=1)

  • Index Cond: (is_shareable = true)
35. 0.687 89.409 ↓ 5.7 1,450 1

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

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

Seq Scan on writers_writer u5 (cost=0.00..3,566.01 rows=253 width=4) (actual time=0.094..88.722 rows=1,450 loops=1)

  • Filter: ((status)::text ~~ 'active:%'::text)
  • Rows Removed by Filter: 49674
37. 62.072 62.072 ↑ 1.0 1 15,518

Index Scan using core_site_pkey on core_site (cost=0.28..0.30 rows=1 width=4) (actual time=0.003..0.004 rows=1 loops=15,518)

  • Index Cond: (id = customers_customer.site_id)
  • Filter: (region_id = 2)
  • Rows Removed by Filter: 0
Planning time : 34.745 ms
Execution time : 3,083.148 ms