explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kTDR

Settings
# exclusive inclusive rows x rows loops node
1. 0.400 5,407.144 ↑ 1.0 20 1

Limit (cost=10,401.47..10,401.52 rows=20 width=620) (actual time=5,406.601..5,407.144 rows=20 loops=1)

2. 107.204 5,406.744 ↑ 86.4 20 1

Sort (cost=10,401.47..10,405.79 rows=1,728 width=620) (actual time=5,406.570..5,406.744 rows=20 loops=1)

  • Sort Key: t0.created_at DESC
  • Sort Method: top-N heapsort Memory: 66kB
3. 338.132 5,299.540 ↓ 3.7 6,391 1

GroupAggregate (cost=10,191.33..10,355.49 rows=1,728 width=620) (actual time=4,824.916..5,299.540 rows=6,391 loops=1)

  • Group Key: t0.id, "order".cancel, "order".is_proceeded, "order".is_feedback, "order".created_at, "order".fax_sent, "order".auction_date, "order".dispid
4. 416.624 4,961.408 ↓ 5.1 8,878 1

Sort (cost=10,191.33..10,195.65 rows=1,728 width=674) (actual time=4,824.825..4,961.408 rows=8,878 loops=1)

  • Sort Key: t0.id, "order".cancel, "order".is_proceeded, "order".is_feedback, "order".created_at, "order".fax_sent, "order".auction_date, "order".dispid
  • Sort Method: external merge Disk: 7408kB
5. 310.950 4,544.784 ↓ 5.1 8,878 1

Nested Loop (cost=3,654.37..10,098.41 rows=1,728 width=674) (actual time=501.877..4,544.784 rows=8,878 loops=1)

6. 0.350 72.237 ↑ 1.0 1 1

Aggregate (cost=2,127.67..2,127.68 rows=1 width=32) (actual time=72.228..72.237 rows=1 loops=1)

7. 1.200 71.887 ↑ 1.5 21 1

Nested Loop (cost=0.29..2,127.58 rows=32 width=8) (actual time=4.821..71.887 rows=21 loops=1)

8. 69.787 69.787 ↑ 1.2 18 1

Seq Scan on "order" cancel_order (cost=0.00..1,920.35 rows=22 width=8) (actual time=4.723..69.787 rows=18 loops=1)

  • Filter: (canceled_from > 0)
  • Rows Removed by Filter: 58970
9. 0.900 0.900 ↑ 2.0 1 18

Index Scan using order_detail_order_id_idx on order_detail cancel_detail (cost=0.29..9.40 rows=2 width=16) (actual time=0.027..0.050 rows=1 loops=18)

  • Index Cond: (order_id = cancel_order.id)
10. 451.143 4,161.597 ↓ 5.1 8,878 1

Nested Loop (cost=1,526.70..7,953.44 rows=1,728 width=642) (actual time=429.616..4,161.597 rows=8,878 loops=1)

11. 549.027 3,435.236 ↓ 5.1 8,878 1

Nested Loop (cost=1,526.41..7,410.76 rows=1,728 width=601) (actual time=429.563..3,435.236 rows=8,878 loops=1)

12. 566.599 2,486.699 ↓ 7.4 8,878 1

Nested Loop (cost=1,525.98..3,607.57 rows=1,198 width=605) (actual time=429.511..2,486.699 rows=8,878 loops=1)

13. 540.849 1,733.662 ↓ 7.4 8,878 1

Nested Loop (cost=1,525.69..3,158.17 rows=1,198 width=593) (actual time=429.463..1,733.662 rows=8,878 loops=1)

14. 289.719 847.699 ↓ 7.6 6,391 1

Hash Join (cost=1,525.40..2,337.98 rows=836 width=730) (actual time=429.404..847.699 rows=6,391 loops=1)

  • Hash Cond: (((t0.metadata ->> 'order_id'::text))::integer = "order".id)
15. 128.660 128.660 ↓ 1.0 6,391 1

Seq Scan on users_app_notification t0 (cost=0.00..729.92 rows=6,359 width=694) (actual time=0.025..128.660 rows=6,391 loops=1)

  • Filter: ((status = ANY ('{1,2}'::integer[])) AND (users_id = 70) AND (COALESCE((metadata ->> 'is_chat_noti'::text), 'false'::text) <> 'true'::text))
  • Rows Removed by Filter: 5
16. 192.878 429.320 ↓ 1.0 7,908 1

Hash (cost=1,428.41..1,428.41 rows=7,759 width=36) (actual time=429.320..429.320 rows=7,908 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 621kB
17. 236.058 236.442 ↓ 1.0 7,908 1

Bitmap Heap Scan on "order" (cost=148.42..1,428.41 rows=7,759 width=36) (actual time=0.496..236.442 rows=7,908 loops=1)

  • Recheck Cond: (ninushi_id = 3)
  • Heap Blocks: exact=816
18. 0.384 0.384 ↓ 1.0 7,908 1

Bitmap Index Scan on order_ninushi_id_idx (cost=0.00..146.48 rows=7,759 width=0) (actual time=0.384..0.384 rows=7,908 loops=1)

  • Index Cond: (ninushi_id = 3)
19. 345.114 345.114 ↑ 2.0 1 6,391

Index Scan using order_detail_order_id_idx on order_detail od (cost=0.29..0.96 rows=2 width=18) (actual time=0.033..0.054 rows=1 loops=6,391)

  • Index Cond: (order_id = "order".id)
20. 186.438 186.438 ↑ 1.0 1 8,878

Index Scan using cart_pkey on cart c (cost=0.29..0.38 rows=1 width=20) (actual time=0.021..0.021 rows=1 loops=8,878)

  • Index Cond: (id = od.cart_id)
21. 399.510 399.510 ↑ 1.0 1 8,878

Index Scan using zaiko_orgid_ver_idx on zaiko zk (cost=0.43..3.16 rows=1 width=20) (actual time=0.030..0.045 rows=1 loops=8,878)

  • Index Cond: ((orgid = c.zaiko_id) AND (ver = c.zaiko_ver))
22. 275.218 275.218 ↑ 1.0 1 8,878

Index Scan using catalog_pkey on catalog ctl (cost=0.29..0.31 rows=1 width=53) (actual time=0.031..0.031 rows=1 loops=8,878)

  • Index Cond: (id = zk.catalog_id)
Planning time : 8.469 ms
Execution time : 5,410.210 ms