explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lWvj

Settings
# exclusive inclusive rows x rows loops node
1. 0.213 124.227 ↑ 443.3 213 1

Nested Loop (cost=0.71..55,467.92 rows=94,414 width=548) (actual time=123.334..124.227 rows=213 loops=1)

2. 0.034 123.375 ↓ 2.1 213 1

Subquery Scan on ANY_subquery (cost=0.29..54,621.42 rows=100 width=4) (actual time=123.298..123.375 rows=213 loops=1)

3. 19.280 123.341 ↓ 2.1 213 1

HashSetOp Intersect (cost=0.29..54,620.42 rows=100 width=8) (actual time=123.297..123.341 rows=213 loops=1)

4. 9.476 104.061 ↓ 1.1 87,291 1

Append (cost=0.29..54,421.30 rows=79,651 width=8) (actual time=0.065..104.061 rows=87,291 loops=1)

5. 0.059 0.180 ↓ 4.0 400 1

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

6. 0.057 0.121 ↓ 4.0 400 1

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

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

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

Subquery Scan on *SELECT* 2 (cost=2,691.83..54,013.22 rows=79,551 width=8) (actual time=8.182..94.405 rows=86,891 loops=1)

9. 23.351 74.687 ↓ 1.1 86,891 1

Gather (cost=2,691.83..53,217.71 rows=79,551 width=4) (actual time=8.181..74.687 rows=86,891 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
10. 34.380 51.336 ↑ 114.4 28,964 3

ProjectSet (cost=1,691.83..44,262.61 rows=3,314,600 width=4) (actual time=2.712..51.336 rows=28,964 loops=3)

11. 9.323 16.956 ↑ 1.3 25,547 3

Parallel Bitmap Heap Scan on patient_logs (cost=1,691.83..27,441.02 rows=33,146 width=25) (actual time=2.700..16.956 rows=25,547 loops=3)

  • Recheck Cond: ((change_date > '2018-07-01'::date) AND (change_date < '2018-07-31'::date))
  • Heap Blocks: exact=268
12. 7.633 7.633 ↑ 1.0 76,642 1

Bitmap Index Scan on patient_logs_change_date_index (cost=0.00..1,671.94 rows=79,551 width=0) (actual time=7.633..7.633 rows=76,642 loops=1)

  • Index Cond: ((change_date > '2018-07-01'::date) AND (change_date < '2018-07-31'::date))
13. 0.000 0.639 ↑ 1.0 1 213

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

14. 0.639 0.639 ↑ 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.003 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))