explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4bpC : Optimization for: plan #lTqi

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.001 0.189 ↑ 1.0 1 1

Limit (cost=64.72..64.72 rows=1 width=573) (actual time=0.189..0.189 rows=1 loops=1)

2. 0.044 0.188 ↑ 2.0 1 1

Sort (cost=64.72..64.72 rows=2 width=573) (actual time=0.188..0.188 rows=1 loops=1)

  • Sort Key: (((keytime.datetimecode ->> 'sampleCount'::text))::bigint)
  • Sort Method: quicksort Memory: 25kB
3. 0.003 0.144 ↑ 1.0 2 1

Unique (cost=64.67..64.71 rows=2 width=573) (actual time=0.142..0.144 rows=2 loops=1)

4. 0.012 0.141 ↑ 1.0 2 1

Sort (cost=64.67..64.68 rows=2 width=573) (actual time=0.141..0.141 rows=2 loops=1)

  • Sort Key: keytime.id, keytime.datetimecode, keytime.fixed, keytime.hint, keytime.samplecount, (((keytime.datetimecode ->> 'sampleCount'::text))::bigint)
  • Sort Method: quicksort Memory: 25kB
5. 0.000 0.129 ↑ 1.0 2 1

Append (cost=60.07..64.66 rows=2 width=573) (actual time=0.113..0.129 rows=2 loops=1)

6. 0.000 0.113 ↑ 1.0 1 1

Limit (cost=60.07..60.08 rows=1 width=183) (actual time=0.113..0.113 rows=1 loops=1)

7. 0.015 0.113 ↑ 17.0 1 1

Sort (cost=60.07..60.12 rows=17 width=183) (actual time=0.112..0.113 rows=1 loops=1)

  • Sort Key: (((keytime.datetimecode ->> 'sampleCount'::text))::bigint)
  • Sort Method: top-N heapsort Memory: 25kB
8. 0.074 0.098 ↓ 2.9 50 1

Bitmap Heap Scan on keytime (cost=4.46..59.99 rows=17 width=183) (actual time=0.036..0.098 rows=50 loops=1)

  • Recheck Cond: ((((datetimecode ->> 'anchorTime'::text))::bigint IS NULL) AND (((datetimecode ->> 'sampleCount'::text))::bigint > '1434595158972000'::bigint))
  • Heap Blocks: exact=44
9. 0.024 0.024 ↓ 2.9 50 1

Bitmap Index Scan on keytime_fixed_samplecount_jsonb_index (cost=0.00..4.46 rows=17 width=0) (actual time=0.024..0.024 rows=50 loops=1)

  • Index Cond: ((((datetimecode ->> 'anchorTime'::text))::bigint IS NULL) AND (((datetimecode ->> 'sampleCount'::text))::bigint > '1434595158972000'::bigint))
10. 0.002 0.016 ↑ 1.0 1 1

Subquery Scan on "*SELECT* 2" (cost=0.29..4.57 rows=1 width=183) (actual time=0.015..0.016 rows=1 loops=1)

11. 0.000 0.014 ↑ 1.0 1 1

Limit (cost=0.29..4.56 rows=1 width=191) (actual time=0.014..0.014 rows=1 loops=1)

12. 0.014 0.014 ↑ 17.0 1 1

Index Scan using keytime_fixed_samplecount_jsonb_index on keytime keytime_1 (cost=0.29..72.92 rows=17 width=191) (actual time=0.014..0.014 rows=1 loops=1)

  • Index Cond: ((((datetimecode ->> 'anchorTime'::text))::bigint = 0) AND (((datetimecode ->> 'sampleCount'::text))::bigint > 0))
Planning time : 0.440 ms
Execution time : 0.250 ms