explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YX4Y

Settings
# exclusive inclusive rows x rows loops node
1. 137.163 137.163 ↑ 1.0 50,000 1

CTE Scan on normalised_data (cost=18,335.94..19,357.84 rows=51,095 width=40) (actual time=0.054..137.163 rows=50,000 loops=1)

2.          

CTE users_dupes

3. 0.000 0.000 ↓ 0.0 0

Append (cost=2,738.67..13,068.06 rows=97,076 width=25) (never executed)

4. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=2,738.67..5,330.04 rows=48,517 width=25) (never executed)

  • Hash Cond: ((d.username)::text = (u.username)::text)
5. 0.000 0.000 ↓ 0.0 0

Index Scan using raw_data_pkey on raw_data d (cost=0.43..2,457.66 rows=51,095 width=17) (never executed)

  • Index Cond: ((id >= 1) AND (id <= 50000))
6. 0.000 0.000 ↓ 0.0 0

Hash (cost=2,190.33..2,190.33 rows=43,833 width=32) (never executed)

7. 0.000 0.000 ↓ 0.0 0

Seq Scan on users u (cost=0.00..2,190.33 rows=43,833 width=32) (never executed)

8. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=2,738.67..6,767.26 rows=48,559 width=25) (never executed)

  • Hash Cond: ((d_1.username)::text = (u_1.email)::text)
9. 0.000 0.000 ↓ 0.0 0

Index Scan using raw_data_pkey on raw_data d_1 (cost=0.43..2,457.66 rows=51,095 width=17) (never executed)

  • Index Cond: ((id >= 1) AND (id <= 50000))
10. 0.000 0.000 ↓ 0.0 0

Hash (cost=2,190.33..2,190.33 rows=43,833 width=34) (never executed)

11. 0.000 0.000 ↓ 0.0 0

Seq Scan on users u_1 (cost=0.00..2,190.33 rows=43,833 width=34) (never executed)

12.          

CTE normalised_data

13. 124.839 124.839 ↑ 1.0 50,000 1

Index Scan using raw_data_pkey on raw_data d_2 (cost=0.43..5,267.88 rows=51,095 width=13) (actual time=0.051..124.839 rows=50,000 loops=1)

  • Index Cond: ((id >= 1) AND (id <= 50000))
Planning time : 0.938 ms
Execution time : 141.762 ms