explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qEgM

Settings
# exclusive inclusive rows x rows loops node
1. 0.176 340.111 ↑ 443.3 213 1

Nested Loop (cost=0.71..64,915.13 rows=94,414 width=548) (actual time=339.026..340.111 rows=213 loops=1)

2. 0.046 338.657 ↓ 2.1 213 1

Subquery Scan on ANY_subquery (cost=0.29..64,068.63 rows=100 width=4) (actual time=338.556..338.657 rows=213 loops=1)

3. 27.445 338.611 ↓ 2.1 213 1

HashSetOp Intersect (cost=0.29..64,067.63 rows=100 width=8) (actual time=338.549..338.611 rows=213 loops=1)

4. 10.302 311.166 ↓ 1.1 87,291 1

Append (cost=0.29..63,868.90 rows=79,490 width=8) (actual time=0.020..311.166 rows=87,291 loops=1)

5. 0.045 0.100 ↓ 4.0 400 1

Subquery Scan on *SELECT* 1 (cost=0.29..9.82 rows=100 width=8) (actual time=0.019..0.100 rows=400 loops=1)

6. 0.036 0.055 ↓ 4.0 400 1

ProjectSet (cost=0.29..8.82 rows=100 width=4) (actual time=0.019..0.055 rows=400 loops=1)

7. 0.019 0.019 ↓ 2.0 2 1

Index Scan using client_logs_client_id_by_date_index on client_logs (cost=0.29..8.31 rows=1 width=827) (actual time=0.017..0.019 rows=2 loops=1)

  • Index Cond: ((client_id = 2962) AND (change_date > '2018-07-01'::date) AND (change_date < '2018-07-31'::date))
8. 20.118 300.764 ↓ 1.1 86,891 1

Subquery Scan on *SELECT* 2 (cost=1,000.00..63,461.64 rows=79,390 width=8) (actual time=0.688..300.764 rows=86,891 loops=1)

9. 0.000 280.646 ↓ 1.1 86,891 1

Gather (cost=1,000.00..62,667.74 rows=79,390 width=4) (actual time=0.688..280.646 rows=86,891 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
10. 24.109 285.993 ↑ 114.2 28,964 3

ProjectSet (cost=0.00..53,728.74 rows=3,307,900 width=4) (actual time=0.080..285.993 rows=28,964 loops=3)

11. 261.884 261.884 ↑ 1.3 25,547 3

Parallel Seq Scan on patient_logs (cost=0.00..36,941.14 rows=33,079 width=25) (actual time=0.077..261.884 rows=25,547 loops=3)

  • Filter: ((change_date > '2018-07-01'::date) AND (change_date < '2018-07-31'::date))
  • Rows Removed by Filter: 600548
12. 0.000 1.278 ↑ 1.0 1 213

Append (cost=0.43..8.46 rows=1 width=548) (actual time=0.006..0.006 rows=1 loops=213)

13. 1.278 1.278 ↑ 1.0 1 213

Index Scan using changes_y2018_change_id_change_date_idx on changes_y2018 (cost=0.43..8.45 rows=1 width=548) (actual time=0.005..0.006 rows=1 loops=213)

  • Index Cond: ((change_id = "ANY_subquery".unnest) AND (change_date > '2018-07-01'::date) AND (change_date < '2018-07-31'::date))