explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NU03

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 5,236.019 ↑ 1.0 10 1

Limit (cost=13.63..15.91 rows=10 width=183) (actual time=6.435..5,236.019 rows=10 loops=1)

2. 87.152 5,236.013 ↑ 85,790.0 10 1

Nested Loop (cost=13.63..196,256.13 rows=857,900 width=183) (actual time=6.434..5,236.013 rows=10 loops=1)

3. 0.002 0.051 ↑ 4,289.5 2 1

Nested Loop (cost=0.97..21,223.08 rows=8,579 width=92) (actual time=0.041..0.051 rows=2 loops=1)

4. 0.029 0.029 ↑ 4,634.0 2 1

Index Scan using audit_operation_created_idx on audit (cost=0.56..10,000.17 rows=9,268 width=85) (actual time=0.027..0.029 rows=2 loops=1)

  • Index Cond: ((operation)::text = 'availabilityRequest'::text)
5. 0.020 0.020 ↑ 1.0 1 2

Index Scan using user_pkey on "user" customer_user (cost=0.42..1.20 rows=1 width=39) (actual time=0.009..0.010 rows=1 loops=2)

  • Index Cond: (uid = audit.user_uid)
  • Filter: ('beAdmin'::text <> ALL (grants))
6. 116.584 5,148.810 ↑ 20.0 5 2

HashAggregate (cost=12.65..16.15 rows=100 width=40) (actual time=2,574.399..2,574.405 rows=5 loops=2)

  • Group Key: date_trunc('day'::text, timezone((((audit.data -> 'req'::text) -> 'query'::text) ->> 'timezone'::text), (((q1.item -> 'time_range'::text) ->> 0))::timestamp with time zone))
7. 5,021.858 5,032.226 ↓ 7.7 769 2

Subquery Scan on q1 (cost=0.43..6.40 rows=100 width=40) (actual time=6.213..2,516.113 rows=769 loops=2)

8. 10.368 10.368 ↓ 7.7 769 2

Index Only Scan using audit_pkey on audit availability (cost=0.43..3.15 rows=100 width=32) (actual time=4.511..5.184 rows=769 loops=2)

  • Index Cond: (uid = audit.uid)
  • Heap Fetches: 2