explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wL6g

Settings
# exclusive inclusive rows x rows loops node
1. 0.033 3,208.595 ↑ 1.0 1 1

Aggregate (cost=360,126.59..360,126.60 rows=1 width=8) (actual time=3,208.595..3,208.595 rows=1 loops=1)

2. 0.478 3,208.562 ↓ 2.9 61 1

Nested Loop (cost=169,064.86..360,126.54 rows=21 width=0) (actual time=2,657.788..3,208.562 rows=61 loops=1)

3. 198.877 3,202.108 ↓ 4.7 747 1

Hash Join (cost=169,064.29..359,694.40 rows=158 width=4) (actual time=2,657.772..3,202.108 rows=747 loops=1)

  • Hash Cond: (oms_restaurantdetails.id = oms_order.restaurant_details_id)
4. 345.774 345.774 ↓ 1.7 295,631 1

Index Scan using oms_restaurantdetails_d266de13 on oms_restaurantdetails (cost=0.57..188,072.04 rows=172,853 width=4) (actual time=0.035..345.774 rows=295,631 loops=1)

  • Index Cond: (area_id = 253)
5. 181.554 2,657.457 ↓ 2.7 386,494 1

Hash (cost=166,724.85..166,724.85 rows=142,550 width=8) (actual time=2,657.457..2,657.457 rows=386,494 loops=1)

  • Buckets: 32768 (originally 32768) Batches: 32 (originally 8) Memory Usage: 793kB
6. 2,475.903 2,475.903 ↓ 2.7 386,494 1

Index Scan using ordered_time_desc_idx on oms_order (cost=0.57..166,724.85 rows=142,550 width=8) (actual time=0.022..2,475.903 rows=386,494 loops=1)

  • Index Cond: (ordered_time >= '2018-12-02 05:18:06.080237+00'::timestamp with time zone)
  • Filter: (((payment_txn_status)::text <> ALL ('{failed,pending}'::text[])) OR (payment_txn_status IS NULL))
  • Rows Removed by Filter: 59387
7. 5.976 5.976 ↓ 0.0 0 747

Index Scan using oms_orderstatus_pkey on oms_orderstatus (cost=0.57..2.73 rows=1 width=4) (actual time=0.007..0.008 rows=0 loops=747)

  • Index Cond: (id = oms_order.status_id)
  • Filter: ((order_status)::text <> ALL ('{delivered,cancelled}'::text[]))
  • Rows Removed by Filter: 1