explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NQd6

Settings
# exclusive inclusive rows x rows loops node
1. 0.068 3.207 ↑ 1.3 870 1

Limit (cost=2,719.10..2,721.85 rows=1,099 width=5,259) (actual time=3.020..3.207 rows=870 loops=1)

2. 0.910 3.139 ↑ 1.3 870 1

Sort (cost=2,719.10..2,721.85 rows=1,099 width=5,259) (actual time=3.018..3.139 rows=870 loops=1)

  • Sort Key: alias_25971257.date_created DESC
  • Sort Method: quicksort Memory: 256kB
3. 0.467 2.229 ↑ 1.3 870 1

Subquery Scan on alias_25971257 (cost=80.71..178.59 rows=1,099 width=5,259) (actual time=1.217..2.229 rows=870 loops=1)

4. 0.139 1.762 ↑ 1.3 870 1

Append (cost=80.71..167.60 rows=1,099 width=5,259) (actual time=1.215..1.762 rows=870 loops=1)

5. 0.146 1.580 ↓ 1.0 870 1

Limit (cost=80.71..82.85 rows=855 width=4,145) (actual time=1.213..1.580 rows=870 loops=1)

6. 0.767 1.434 ↓ 1.0 870 1

Sort (cost=80.71..82.85 rows=855 width=4,145) (actual time=1.212..1.434 rows=870 loops=1)

  • Sort Key: c.created_date DESC
  • Sort Method: quicksort Memory: 256kB
7. 0.286 0.667 ↓ 1.0 870 1

Hash Left Join (cost=1.48..39.07 rows=855 width=4,145) (actual time=0.116..0.667 rows=870 loops=1)

  • Hash Cond: (c.card_brand = t.brand)
8. 0.328 0.328 ↓ 1.0 870 1

Seq Scan on charges c (cost=0.00..34.38 rows=855 width=4,049) (actual time=0.038..0.328 rows=870 loops=1)

  • Filter: (gateway_account_id = 2)
  • Rows Removed by Filter: 55
9. 0.009 0.053 ↑ 1.1 8 1

Hash (cost=1.37..1.37 rows=9 width=64) (actual time=0.053..0.053 rows=8 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
10. 0.001 0.044 ↑ 1.1 8 1

Subquery Scan on t (cost=1.23..1.37 rows=9 width=64) (actual time=0.035..0.044 rows=8 loops=1)

11. 0.007 0.043 ↑ 1.1 8 1

Unique (cost=1.23..1.28 rows=9 width=137) (actual time=0.035..0.043 rows=8 loops=1)

12. 0.028 0.036 ↓ 1.1 10 1

Sort (cost=1.23..1.26 rows=9 width=137) (actual time=0.034..0.036 rows=10 loops=1)

  • Sort Key: card_types.label
  • Sort Method: quicksort Memory: 25kB
13. 0.008 0.008 ↓ 1.1 10 1

Seq Scan on card_types (cost=0.00..1.09 rows=9 width=137) (actual time=0.006..0.008 rows=10 loops=1)

14. 0.000 0.043 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2 (cost=73.16..76.21 rows=244 width=4,169) (actual time=0.043..0.043 rows=0 loops=1)

15. 0.001 0.043 ↓ 0.0 0 1

Limit (cost=73.16..73.77 rows=244 width=4,205) (actual time=0.043..0.043 rows=0 loops=1)

16. 0.015 0.042 ↓ 0.0 0 1

Sort (cost=73.16..73.77 rows=244 width=4,205) (actual time=0.042..0.042 rows=0 loops=1)

  • Sort Key: r.created_date DESC
  • Sort Method: quicksort Memory: 25kB
17. 0.001 0.027 ↓ 0.0 0 1

Hash Left Join (cost=46.54..63.48 rows=244 width=4,205) (actual time=0.027..0.027 rows=0 loops=1)

  • Hash Cond: (c_1.card_brand = t_1.brand)
18. 0.001 0.026 ↓ 0.0 0 1

Hash Join (cost=45.06..61.08 rows=244 width=4,141) (actual time=0.026..0.026 rows=0 loops=1)

  • Hash Cond: (r.charge_id = c_1.id)
19. 0.025 0.025 ↓ 0.0 0 1

Seq Scan on refunds r (cost=0.00..12.60 rows=260 width=124) (actual time=0.025..0.025 rows=0 loops=1)

20. 0.000 0.000 ↓ 0.0 0

Hash (cost=34.38..34.38 rows=855 width=4,025) (never executed)

21. 0.000 0.000 ↓ 0.0 0

Seq Scan on charges c_1 (cost=0.00..34.38 rows=855 width=4,025) (never executed)

  • Filter: (gateway_account_id = 2)
22. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.37..1.37 rows=9 width=64) (never executed)

23. 0.000 0.000 ↓ 0.0 0

Subquery Scan on t_1 (cost=1.23..1.37 rows=9 width=64) (never executed)

24. 0.000 0.000 ↓ 0.0 0

Unique (cost=1.23..1.28 rows=9 width=137) (never executed)

25. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.23..1.26 rows=9 width=137) (never executed)

  • Sort Key: card_types_1.label
26. 0.000 0.000 ↓ 0.0 0

Seq Scan on card_types card_types_1 (cost=0.00..1.09 rows=9 width=137) (never executed)