explain.depesz.com

A tool for finding a real cause for slow queries.

Result: 2F9

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 0.001 89.678 ↑ 1.0 10 1

Limit (cost=17835.01..17835.03 rows=10 width=91) (actual time=89.676..89.678 rows=10 loops=1)

2. 1.742 89.677 ↑ 186.9 10 1

Sort (cost=17835.01..17839.68 rows=1869 width=91) (actual time=89.675..89.677 rows=10 loops=1)

  • Sort Key: lir.amount
  • Sort Method: top-N heapsort Memory: 26kB
3. 1.086 87.935 ↓ 1.2 2188 1

Hash Join (cost=4017.85..17794.62 rows=1869 width=91) (actual time=59.445..87.935 rows=2188 loops=1)

  • Hash Cond: (r.refund_reason_id = rr.id)
4. 1.111 86.838 ↓ 1.2 2188 1

Hash Join (cost=4016.71..17767.78 rows=1869 width=77) (actual time=59.419..86.838 rows=2188 loops=1)

  • Hash Cond: (p.drop_shipper_id = ds.id)
5. 2.879 85.620 ↓ 1.2 2188 1

Hash Join (cost=4007.08..17732.45 rows=1869 width=59) (actual time=59.297..85.620 rows=2188 loops=1)

  • Hash Cond: (li.product_id = p.id)
6. 2.313 47.695 ↓ 1.2 2188 1

Nested Loop (cost=1128.79..14809.77 rows=1869 width=22) (actual time=24.211..47.695 rows=2188 loops=1)

7. 5.717 30.066 ↓ 1.2 2188 1

Hash Join (cost=1128.79..1735.63 rows=1869 width=22) (actual time=24.180..30.066 rows=2188 loops=1)

  • Hash Cond: (lir.refund_id = r.id)
8. 4.033 4.033 ↑ 1.0 28810 1

Seq Scan on line_item_refunds lir (cost=0.00..444.10 rows=28810 width=14) (actual time=0.009..4.033 rows=28810 loops=1)

9. 0.566 20.316 ↓ 1.0 1711 1

Hash (cost=1107.59..1107.59 rows=1696 width=16) (actual time=20.316..20.316 rows=1711 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 81kB
10. 19.750 19.750 ↓ 1.0 1711 1

Seq Scan on refunds r (cost=0.00..1107.59 rows=1696 width=16) (actual time=0.622..19.750 rows=1711 loops=1)

  • Filter: (created_at > (now() - '2 mons'::interval))
11. 15.316 15.316 ↑ 1.0 1 2188

Index Scan using line_items_pkey on line_items li (cost=0.00..6.98 rows=1 width=8) (actual time=0.007..0.007 rows=1 loops=2188)

  • Index Cond: (id = lir.line_item_id)
12. 7.874 35.046 ↑ 1.0 17924 1

Hash (cost=2654.24..2654.24 rows=17924 width=45) (actual time=35.046..35.046 rows=17924 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 1384kB
13. 27.172 27.172 ↑ 1.0 17924 1

Seq Scan on products p (cost=0.00..2654.24 rows=17924 width=45) (actual time=0.004..27.172 rows=17924 loops=1)

14. 0.050 0.107 ↑ 1.0 206 1

Hash (cost=7.06..7.06 rows=206 width=26) (actual time=0.107..0.107 rows=206 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
15. 0.057 0.057 ↑ 1.0 206 1

Seq Scan on drop_shippers ds (cost=0.00..7.06 rows=206 width=26) (actual time=0.005..0.057 rows=206 loops=1)

16. 0.006 0.011 ↑ 1.0 6 1

Hash (cost=1.06..1.06 rows=6 width=22) (actual time=0.011..0.011 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
17. 0.005 0.005 ↑ 1.0 6 1

Seq Scan on refund_reasons rr (cost=0.00..1.06 rows=6 width=22) (actual time=0.004..0.005 rows=6 loops=1)