explain.depesz.com

PostgreSQL's explain analyze made readable

Result: N38K

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 2,314.209 ↑ 1.0 1 1

Limit (cost=350,241.75..350,241.75 rows=1 width=929) (actual time=2,314.209..2,314.209 rows=1 loops=1)

2. 416.235 2,314.208 ↑ 255,594.0 1 1

Sort (cost=350,241.75..350,880.74 rows=255,594 width=929) (actual time=2,314.208..2,314.208 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,741.482 1,897.973 ↓ 1.1 277,776 1

Bitmap Heap Scan on "Payment" (cost=7,692.27..348,963.78 rows=255,594 width=929) (actual time=173.492..1,897.973 rows=277,776 loops=1)

  • Recheck Cond: (("accountId" = 3) AND ((currency)::text = 'usd'::text))
  • Rows Removed by Index Recheck: 819471
  • Heap Blocks: exact=39323 lossy=106035
4. 156.491 156.491 ↓ 1.1 277,776 1

Bitmap Index Scan on payment_accountid_paymentdate_state_index (cost=0.00..7,628.37 rows=255,594 width=0) (actual time=156.491..156.491 rows=277,776 loops=1)

  • Index Cond: (("accountId" = 3) AND ((currency)::text = 'usd'::text))
Planning time : 0.453 ms