explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KGU1

Settings
# exclusive inclusive rows x rows loops node
1. 0.041 12,788.009 ↓ 2.5 25 1

Limit (cost=166,099.68..166,099.71 rows=10 width=1,002) (actual time=12,787.952..12,788.009 rows=25 loops=1)

2. 58.079 12,787.968 ↓ 2.5 25 1

Sort (cost=166,099.68..166,099.71 rows=10 width=1,002) (actual time=12,787.949..12,787.968 rows=25 loops=1)

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

Nested Loop (cost=13,744.02..166,099.51 rows=10 width=1,002) (actual time=6,011.049..12,729.889 rows=14,135 loops=1)

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

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

5. 1,495.585 7,352.192 ↓ 1,413.5 14,135 568

Materialize (cost=13,744.02..165,994.62 rows=10 width=947) (actual time=6.577..12.944 rows=14,135 loops=568)

6. 1,733.113 5,856.607 ↓ 1,413.5 14,135 1

Nested Loop (cost=13,744.02..165,994.57 rows=10 width=947) (actual time=3,735.189..5,856.607 rows=14,135 loops=1)

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

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

8. 495.379 4,122.668 ↓ 1,413.5 14,135 172

Materialize (cost=13,744.02..165,970.03 rows=10 width=910) (actual time=4.381..23.969 rows=14,135 loops=172)

9. 78.338 3,627.289 ↓ 1,413.5 14,135 1

Hash Semi Join (cost=13,744.02..165,969.98 rows=10 width=910) (actual time=753.367..3,627.289 rows=14,135 loops=1)

  • Hash Cond: (feedback_customer_feedback.id = "ANY_subquery".id)
10. 95.857 2,949.747 ↓ 2.0 87,431 1

Hash Join (cost=7,102.87..159,213.18 rows=44,018 width=910) (actual time=153.499..2,949.747 rows=87,431 loops=1)

  • Hash Cond: (essays_order.paper_subject_id = essays_papersubject.id)
11. 92.374 2,853.295 ↓ 2.0 87,431 1

Hash Left Join (cost=7,077.23..158,582.29 rows=44,018 width=868) (actual time=152.855..2,853.295 rows=87,431 loops=1)

  • Hash Cond: (customers_customer.country_id = core_country.id)
12. 89.621 2,760.746 ↓ 2.0 87,431 1

Hash Join (cost=7,068.83..157,968.65 rows=44,018 width=820) (actual time=152.642..2,760.746 rows=87,431 loops=1)

  • Hash Cond: (customers_customer.site_id = core_site.id)
13. 119.126 2,670.380 ↓ 2.0 87,431 1

Nested Loop (cost=6,993.18..157,287.74 rows=44,018 width=820) (actual time=151.870..2,670.380 rows=87,431 loops=1)

14. 85.836 1,764.375 ↓ 2.0 87,431 1

Hash Left Join (cost=6,992.75..112,814.56 rows=44,018 width=553) (actual time=151.835..1,764.375 rows=87,431 loops=1)

  • Hash Cond: (writers_writer.id = writers_widget_stats_view.writer_id)
15. 131.117 1,677.870 ↓ 2.0 87,431 1

Hash Left Join (cost=6,950.13..112,594.28 rows=44,018 width=485) (actual time=151.125..1,677.870 rows=87,431 loops=1)

  • Hash Cond: (feedback_customer_feedback.writer_id = writers_writer.id)
16. 1,143.587 1,523.617 ↓ 2.0 87,431 1

Hash Join (cost=4,987.97..110,026.91 rows=44,018 width=481) (actual time=127.544..1,523.617 rows=87,431 loops=1)

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

Seq Scan on essays_order (cost=0.00..78,577.18 rows=1,449,218 width=374) (actual time=0.010..253.210 rows=1,452,412 loops=1)

18. 59.753 126.801 ↑ 1.0 87,431 1

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

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

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

SubPlan (forHash Join)

21. 0.019 0.019 ↓ 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.019..0.019 rows=0 loops=1)

  • Index Cond: (customer_id = 617936)
  • Filter: is_active
22. 14.775 23.136 ↓ 1.0 51,124 1

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

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

  • Heap Fetches: 628
24. 0.372 0.669 ↑ 1.0 1,450 1

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

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

26. 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=267) (actual time=0.009..0.009 rows=1 loops=87,431)

  • Index Cond: (id = essays_order.customer_id)
27. 0.288 0.745 ↓ 1.0 1,737 1

Hash (cost=54.18..54.18 rows=1,718 width=4) (actual time=0.745..0.745 rows=1,737 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 78kB
28. 0.457 0.457 ↓ 1.0 1,737 1

Seq Scan on core_site (cost=0.00..54.18 rows=1,718 width=4) (actual time=0.017..0.457 rows=1,737 loops=1)

29. 0.097 0.175 ↓ 1.0 241 1

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

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

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

31. 0.279 0.595 ↓ 1.0 785 1

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

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

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

33. 10.913 599.204 ↓ 556.4 15,023 1

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

  • Buckets: 16384 (originally 1024) Batches: 1 (originally 1) Memory Usage: 715kB
34. 1.726 588.291 ↓ 556.4 15,023 1

Subquery Scan on ANY_subquery (cost=6,640.40..6,640.81 rows=27 width=8) (actual time=581.652..588.291 rows=15,023 loops=1)

35. 2.284 586.565 ↓ 556.4 15,023 1

Unique (cost=6,640.40..6,640.54 rows=27 width=24) (actual time=581.651..586.565 rows=15,023 loops=1)

36. 16.945 584.281 ↓ 557.1 15,043 1

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

  • Sort Key: u0.order_id, u0.approve_date DESC
  • Sort Method: quicksort Memory: 1560kB
37. 8.790 567.336 ↓ 557.1 15,043 1

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

38. 7.988 459.102 ↓ 385.4 16,574 1

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

39. 8.239 235.652 ↓ 385.4 16,574 1

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

40. 12.731 94.821 ↓ 385.4 16,574 1

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

  • Hash Cond: (u0.writer_id = u6.id)
41. 29.922 31.271 ↓ 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=1.545..31.271 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
42. 1.349 1.349 ↑ 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=1.349..1.349 rows=19,037 loops=1)

  • Index Cond: (is_shareable = true)
43. 0.394 50.819 ↓ 5.7 1,450 1

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

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

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

  • Filter: ((status)::text ~~ 'active:%'::text)
  • Rows Removed by Filter: 49674
45. 132.592 132.592 ↑ 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.008..0.008 rows=1 loops=16,574)

  • Index Cond: (id = u0.order_id)
46. 215.462 215.462 ↑ 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.013..0.013 rows=1 loops=16,574)

  • Index Cond: (id = u1.customer_id)
47. 99.444 99.444 ↑ 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.006..0.006 rows=1 loops=16,574)

  • Index Cond: (id = u2.site_id)
  • Filter: (region_id = 2)
  • Rows Removed by Filter: 0
Planning time : 25.255 ms
Execution time : 12,792.303 ms