explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tTir

Settings
# exclusive inclusive rows x rows loops node
1. 0.169 322.618 ↑ 443.3 213 1

Nested Loop (cost=0.71..64,815.30 rows=94,414 width=548) (actual time=321.564..322.618 rows=213 loops=1)

2. 0.040 321.597 ↓ 2.1 213 1

Subquery Scan on ANY_subquery (cost=0.29..63,968.80 rows=100 width=4) (actual time=321.496..321.597 rows=213 loops=1)

3. 16.199 321.557 ↓ 2.1 213 1

HashSetOp Intersect (cost=0.29..63,967.80 rows=100 width=8) (actual time=321.494..321.557 rows=213 loops=1)

4. 11.872 305.358 ↓ 1.1 87,291 1

Append (cost=0.29..63,769.39 rows=79,364 width=8) (actual time=0.020..305.358 rows=87,291 loops=1)

5. 0.051 0.117 ↓ 4.0 400 1

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

6. 0.046 0.066 ↓ 4.0 400 1

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

7. 0.020 0.020 ↓ 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.020 rows=2 loops=1)

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

Subquery Scan on *SELECT* 2 (cost=1,000.00..63,362.75 rows=79,264 width=8) (actual time=66.225..293.369 rows=86,891 loops=1)

9. 2.627 278.855 ↓ 1.1 86,891 1

Gather (cost=1,000.00..62,570.11 rows=79,264 width=4) (actual time=66.224..278.855 rows=86,891 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
10. 23.465 276.228 ↑ 114.0 28,964 3

ProjectSet (cost=0.00..53,643.71 rows=3,302,700 width=4) (actual time=59.412..276.228 rows=28,964 loops=3)

11. 252.763 252.763 ↑ 1.3 25,547 3

Parallel Seq Scan on patient_logs (cost=0.00..36,882.51 rows=33,027 width=25) (actual time=59.404..252.763 rows=25,547 loops=3)

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

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

13. 0.852 0.852 ↑ 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.003..0.004 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))