explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Q36m

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.057 0.585 ↑ 1.0 10 1

Limit (cost=58.05..58.08 rows=10 width=209) (actual time=0.517..0.585 rows=10 loops=1)

  • Output: transaction_id, platform, user_id, (CASE WHEN (lock_ts >= '2019-05-10 21:27:47.798787'::timestamp without time zone) THEN 'locked'::text ELSE (status)::text END), item, quantity, pending_ts, pending_ts, transaction_id, platform, NULL::timestamp without time zone, NULL::text, NULL::platform
  • Buffers: shared hit=6
2. 0.247 0.528 ↑ 4.9 10 1

Sort (cost=58.05..58.18 rows=49 width=209) (actual time=0.513..0.528 rows=10 loops=1)

  • Output: transaction_id, platform, user_id, (CASE WHEN (lock_ts >= '2019-05-10 21:27:47.798787'::timestamp without time zone) THEN 'locked'::text ELSE (status)::text END), item, quantity, pending_ts, pending_ts, transaction_id, platform, NULL::timestamp without time zone, NULL::text, NULL::platform
  • Sort Key: transaction.pending_ts, transaction.transaction_id, transaction.platform
  • Sort Method: top-N heapsort Memory: 29kB
  • Buffers: shared hit=6
3. 0.281 0.281 ↓ 1.0 50 1

Index Scan using transaction_user_status_game on public.transaction (cost=0.42..57.00 rows=49 width=209) (actual time=0.129..0.281 rows=50 loops=1)

  • Output: transaction_id, platform, user_id, CASE WHEN (lock_ts >= '2019-05-10 21:27:47.798787'::timestamp without time zone) THEN 'locked'::text ELSE (status)::text END, item, quantity, pending_ts, pending_ts, transaction_id, platform, NULL::timestamp without time zone, NULL::text, NULL::platform
  • Index Cond: ((transaction.user_id = 'fc7a353b4b3c88081a8e0913f26d3971'::text) AND (transaction.status = 'pending'::rv_status) AND (transaction.game = 'test'::text))
  • Filter: ((transaction.fulfilled_ts IS NULL) AND (transaction.pending_ts > '-infinity'::timestamp without time zone))
  • Buffers: shared hit=6