explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4EGN

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 6,799.729 ↓ 20.0 20 1

Limit (cost=1,891,903.23..1,891,903.24 rows=1 width=36) (actual time=6,799.726..6,799.729 rows=20 loops=1)

2.          

Initplan (forLimit)

3. 0.018 0.018 ↑ 1.0 1 1

Result (cost=0.00..0.03 rows=1 width=0) (actual time=0.018..0.018 rows=1 loops=1)

4. 0.005 0.005 ↑ 1.0 1 1

Result (cost=0.00..0.03 rows=1 width=0) (actual time=0.005..0.005 rows=1 loops=1)

5. 44.479 6,799.727 ↓ 20.0 20 1

Sort (cost=1,891,903.17..1,891,903.17 rows=1 width=36) (actual time=6,799.724..6,799.727 rows=20 loops=1)

  • Sort Key: (COALESCE(sum(count), 0::bigint))
  • Sort Method: top-N heapsort Memory: 26kB
6. 1,831.616 6,755.248 ↓ 235,536.0 235,536 1

HashAggregate (cost=1,891,903.15..1,891,903.16 rows=1 width=36) (actual time=6,695.017..6,755.248 rows=235,536 loops=1)

  • Group Key: reason
7. 3,234.240 4,923.632 ↓ 4,704.5 6,713,332 1

Bitmap Heap Scan on paymentaggregationdaily acquirer_response (cost=1,348,368.58..1,891,896.01 rows=1,427 width=36) (actual time=1,691.389..4,923.632 rows=6,713,332 loops=1)

  • Recheck Cond: ((date >= $0) AND (date < $1))
  • Rows Removed by Index Recheck: 95
  • Filter: (CASE WHEN (result = 0) THEN 'Unknown'::text WHEN (result = 1) THEN 'Approved'::text WHEN (result = 2) THEN 'Refused'::text WHEN (result = 4) THEN 'Error'::text ELSE NULL::text END = 'Refused'::text)
  • Rows Removed by Filter: 5667842
  • Heap Blocks: exact=13446 lossy=145162
8. 1,689.392 1,689.392 ↓ 43.4 12,381,174 1

Bitmap Index Scan on pad_txvariantid_date_idx (cost=0.00..1,348,368.23 rows=285,316 width=0) (actual time=1,689.392..1,689.392 rows=12,381,174 loops=1)

  • Index Cond: ((date >= $0) AND (date < $1))