explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZX85

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 2,216.381 ↑ 1.0 1 1

Limit (cost=349,109.75..349,109.75 rows=1 width=929) (actual time=2,216.380..2,216.381 rows=1 loops=1)

2. 392.488 2,216.379 ↑ 255,594.0 1 1

Sort (cost=349,109.75..349,748.74 rows=255,594 width=929) (actual time=2,216.379..2,216.379 rows=1 loops=1)

  • Sort Key: "paymentDate" DESC, (CASE WHEN ((state)::text = 'Pending'::text) THEN 1 ELSE 2 END)
  • Sort Method: top-N heapsort Memory: 25kB
3. 1,699.067 1,823.891 ↓ 1.1 277,776 1

Bitmap Heap Scan on "Payment" (cost=6,560.27..347,831.78 rows=255,594 width=929) (actual time=141.610..1,823.891 rows=277,776 loops=1)

  • Recheck Cond: (("accountId" = 3) AND ((currency)::text = 'usd'::text))
  • Rows Removed by Index Recheck: 818,647
  • Heap Blocks: exact=39,386 lossy=105,972
4. 124.824 124.824 ↓ 1.1 277,776 1

Bitmap Index Scan on payment_accountid_currency_index (cost=0.00..6,496.37 rows=255,594 width=0) (actual time=124.824..124.824 rows=277,776 loops=1)

  • Index Cond: (("accountId" = 3) AND ((currency)::text = 'usd'::text))