explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PGLq

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Merge Join (cost=810,985.92..1,213,663.04 rows=26,636,730 width=1,738) (actual rows= loops=)

  • Merge Cond: (fr.filter_version_id = cv.version_id)
2. 0.000 0.000 ↓ 0.0

Sort (cost=618,325.35..618,943.20 rows=247,139 width=1,746) (actual rows= loops=)

  • Sort Key: fr.filter_version_id
3. 0.000 0.000 ↓ 0.0

Hash Join (cost=187,988.74..221,134.92 rows=247,139 width=1,746) (actual rows= loops=)

  • Hash Cond: (fr.filter_id = f.filter_id)
4. 0.000 0.000 ↓ 0.0

Merge Anti Join (cost=187,575.49..217,323.51 rows=247,139 width=1,746) (actual rows= loops=)

  • Merge Cond: (fr.filter_revision_id = fo.filter_revision_id)
5. 0.000 0.000 ↓ 0.0

Index Scan using filter_revision_pkey on filter_revisions fr (cost=0.42..20,065.24 rows=356,971 width=1,754) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Materialize (cost=187,575.07..190,086.72 rows=502,330 width=8) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Sort (cost=187,575.07..188,830.89 rows=502,330 width=8) (actual rows= loops=)

  • Sort Key: fo.filter_revision_id
8. 0.000 0.000 ↓ 0.0

Hash Join (cost=110,380.99..133,138.24 rows=502,330 width=8) (actual rows= loops=)

  • Hash Cond: (fo.filter_overridden_by_version_id = current_versions.version_id)
9. 0.000 0.000 ↓ 0.0

Seq Scan on filters_overridden fo (cost=0.00..18,419.60 rows=1,004,660 width=16) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Hash (cost=110,378.49..110,378.49 rows=200 width=8) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

HashAggregate (cost=110,376.49..110,378.49 rows=200 width=8) (actual rows= loops=)

  • Group Key: current_versions.version_id
12. 0.000 0.000 ↓ 0.0

Subquery Scan on current_versions (cost=85,800.41..108,486.02 rows=756,187 width=8) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

CTE Scan on versions_cte vers (cost=85,800.41..100,924.15 rows=756,187 width=126) (actual rows= loops=)

  • -> Recursive Union (cost=56.79..858