explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ShzK

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

Hash Join (cost=1,366,049.14..3,513,563.59 rows=2,130,628 width=16) (actual rows= loops=)

  • Hash Cond: (vhc.vuln_hostname_id = vh.id)
2.          

CTE hostnames

3. 0.000 0.000 ↓ 0.0

HashAggregate (cost=375.82..657.19 rows=28,137 width=8) (actual rows= loops=)

  • Group Key: h_1.id
4. 0.000 0.000 ↓ 0.0

Append (cost=1.27..305.48 rows=28,137 width=8) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.27..10.77 rows=28,135 width=8) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.83..4.88 rows=1 width=8) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Index Scan using organisations_pkey on organisations o (cost=0.15..2.17 rows=1 width=11) (actual rows= loops=)

  • Index Cond: (id = 33)
8. 0.000 0.000 ↓ 0.0

Index Only Scan using cloudscans_hostname_by_hostname_vendorid on cloudscans_hostnames oh (cost=0.69..2.70 rows=1 width=70) (actual rows= loops=)

  • Index Cond: (hostname = o.primary_hostname)
9. 0.000 0.000 ↓ 0.0

Index Scan using cloudscans_hostnames_vendorid_enabled_without_id on cloudscans_hostnames h_1 (cost=0.43..4.08 rows=181 width=16) (actual rows= loops=)

  • Index Cond: ((enabled = true) AND (datastore_vendor_id = oh.datastore_vendor_id))
  • Filter: enabled
10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.86..13.34 rows=2 width=8) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Index Only Scan using organisations_pkey on organisations o_1 (cost=0.15..2.17 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = 33)
12. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.71..11.16 rows=2 width=16) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Index Scan using cloudscans_orgmap_orgid on cloudscans_orgmap co (cost=0.28..3.77 rows=3 width=16) (actual rows= loops=)

  • Index Cond: (org_id = 33)
14. 0.000 0.000 ↓ 0.0

Index Scan using cloudscans_hostnames_pkey on cloudscans_hostnames h_2 (cost=0.43..2.45 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = co.hostname_id)
  • Filter: enabled
15. 0.000 0.000 ↓ 0.0

Seq Scan on vulns_hostnames_cpes vhc (cost=0.00..1,149,514.78 rows=65,299,278 width=12) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Hash (cost=1,326,204.65..1,326,204.65 rows=2,134,424 width=20) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.56..1,326,204.65 rows=2,134,424 width=20) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

CTE Scan on hostnames h (cost=0.00..562.74 rows=28,137 width=8) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Index Scan using temp on vulns_hostnames vh (cost=0.56..46.35 rows=76 width=20) (actual rows= loops=)

  • Index Cond: (hostname_id = h.id)