explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TXN1

Settings
# exclusive inclusive rows x rows loops node
1. 0.066 1,119.986 ↑ 1.0 1 1

Aggregate (cost=7,120.45..7,120.46 rows=1 width=8) (actual time=1,119.986..1,119.986 rows=1 loops=1)

2. 0.212 1,119.920 ↓ 795.0 795 1

Group (cost=7,120.42..7,120.44 rows=1 width=84) (actual time=1,119.542..1,119.920 rows=795 loops=1)

  • Group Key: feedback_customer_feedback.id, writers_widget_stats_view.completed_orders, writers_widget_stats_view.price_per_page, writers_widget_stats_view.satisfaction_rate, (COALESCE(feedback_customer_feedback.writer_id, essays_order.writer_id))
3. 1.462 1,119.708 ↓ 795.0 795 1

Sort (cost=7,120.42..7,120.42 rows=1 width=84) (actual time=1,119.540..1,119.708 rows=795 loops=1)

  • Sort Key: feedback_customer_feedback.id, writers_widget_stats_view.completed_orders, writers_widget_stats_view.price_per_page, writers_widget_stats_view.satisfaction_rate, (COALESCE(feedback_customer_feedback.writer_id, essays_order.writer_id))
  • Sort Method: quicksort Memory: 87kB
4. 13.089 1,118.246 ↓ 795.0 795 1

Nested Loop Left Join (cost=6,648.77..7,120.41 rows=1 width=84) (actual time=551.986..1,118.246 rows=795 loops=1)

5. 8.864 863.477 ↓ 795.0 795 1

Nested Loop (cost=6,648.44..7,090.12 rows=1 width=16) (actual time=551.677..863.477 rows=795 loops=1)

6. 12.919 713.263 ↓ 706.8 14,135 1

Nested Loop (cost=6,639.71..6,863.71 rows=20 width=20) (actual time=551.174..713.263 rows=14,135 loops=1)

7. 24.719 565.137 ↓ 556.4 15,023 1

HashAggregate (cost=6,639.29..6,639.56 rows=27 width=8) (actual time=551.112..565.137 rows=15,023 loops=1)

  • Group Key: u0.id
8. 2.298 540.418 ↓ 556.4 15,023 1

Unique (cost=6,638.82..6,638.96 rows=27 width=24) (actual time=534.550..540.418 rows=15,023 loops=1)

9. 21.273 538.120 ↓ 557.1 15,043 1

Sort (cost=6,638.82..6,638.89 rows=27 width=24) (actual time=534.549..538.120 rows=15,043 loops=1)

  • Sort Key: u0.order_id, u0.approve_date DESC
  • Sort Method: quicksort Memory: 1560kB
10. 5.045 516.847 ↓ 557.1 15,043 1

Nested Loop (cost=3,952.82..6,638.18 rows=27 width=24) (actual time=61.129..516.847 rows=15,043 loops=1)

11. 10.833 445.506 ↓ 385.4 16,574 1

Nested Loop (cost=3,952.54..6,624.94 rows=43 width=28) (actual time=61.114..445.506 rows=16,574 loops=1)

12. 19.410 252.359 ↓ 385.4 16,574 1

Nested Loop (cost=3,952.12..6,581.30 rows=43 width=28) (actual time=61.094..252.359 rows=16,574 loops=1)

13. 17.993 116.931 ↓ 385.4 16,574 1

Hash Join (cost=3,951.69..6,321.77 rows=43 width=24) (actual time=61.062..116.931 rows=16,574 loops=1)

  • Hash Cond: (u0.writer_id = u6.id)
14. 38.145 39.970 ↓ 2.2 18,969 1

Bitmap Heap Scan on feedback_customer_feedback u0 (cost=377.23..2,714.31 rows=8,686 width=28) (actual time=2.065..39.970 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=1744
15. 1.825 1.825 ↑ 1.1 19,036 1

Bitmap Index Scan on feedback_is_shareable__idx (cost=0.00..375.06 rows=20,086 width=0) (actual time=1.824..1.825 rows=19,036 loops=1)

  • Index Cond: (is_shareable = true)
16. 0.558 58.968 ↓ 5.7 1,450 1

Hash (cost=3,571.27..3,571.27 rows=255 width=4) (actual time=58.968..58.968 rows=1,450 loops=1)

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

Seq Scan on writers_writer u6 (cost=0.00..3,571.27 rows=255 width=4) (actual time=0.067..58.410 rows=1,450 loops=1)

  • Filter: ((status)::text ~~ 'active:%'::text)
  • Rows Removed by Filter: 49671
18. 116.018 116.018 ↑ 1.0 1 16,574

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

  • Index Cond: (id = u0.order_id)
19. 182.314 182.314 ↑ 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.011..0.011 rows=1 loops=16,574)

  • Index Cond: (id = u1.customer_id)
20. 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
21. 135.207 135.207 ↑ 1.0 1 15,023

Index Scan using feedback_customer_feedback_pkey on feedback_customer_feedback (cost=0.42..8.29 rows=1 width=20) (actual time=0.009..0.009 rows=1 loops=15,023)

  • Index Cond: (id = u0.id)
  • Filter: ((paper_rating > 8) AND (paper_rating <= 10))
  • Rows Removed by Filter: 0
22. 141.337 141.350 ↓ 0.0 0 14,135

Index Scan using essays_order_pkey on essays_order (cost=8.73..11.31 rows=1 width=12) (actual time=0.010..0.010 rows=0 loops=14,135)

  • Index Cond: (id = feedback_customer_feedback.order_id)
  • Filter: ((paper_subject_id = 359) AND (level_work_id = 2) AND (NOT (hashed SubPlan 1)))
  • Rows Removed by Filter: 1
23.          

SubPlan (forIndex Scan)

24. 0.013 0.013 ↓ 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.013..0.013 rows=0 loops=1)

  • Index Cond: (customer_id = 617936)
  • Filter: is_active
25. 132.765 241.680 ↑ 1.0 1 795

Hash Right Join (cost=0.33..30.27 rows=1 width=76) (actual time=0.212..0.304 rows=1 loops=795)

  • Hash Cond: (writers_widget_stats_view.writer_id = writers_writer.id)
26. 101.760 101.760 ↑ 1.0 1,450 795

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

27. 0.795 7.155 ↑ 1.0 1 795

Hash (cost=0.31..0.31 rows=1 width=4) (actual time=0.009..0.009 rows=1 loops=795)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
28. 6.360 6.360 ↑ 1.0 1 795

Index Only Scan using writers_writer_pkey on writers_writer (cost=0.29..0.31 rows=1 width=4) (actual time=0.007..0.008 rows=1 loops=795)

  • Index Cond: (id = feedback_customer_feedback.writer_id)
  • Heap Fetches: 0
Planning time : 2.563 ms
Execution time : 1,120.390 ms