explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NNq0

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

Hash Join (cost=20,889.56..20,893.57 rows=2 width=249) (actual rows= loops=)

  • Hash Cond: (t.report_id = r.report_id)
  • Join Filter: (t.consumed_resource_uri <> ANY (r.app_ids))
2.          

CTE company_seed

3. 0.000 0.000 ↓ 0.0

HashAggregate (cost=30.88..30.90 rows=2 width=54) (actual rows= loops=)

  • Group Key: discover_seed_rollup.report_id, discover_seed_rollup.company_id, discover_seed_rollup.sampled_rate
4. 0.000 0.000 ↓ 0.0

Seq Scan on discover_seed_rollup (cost=0.00..22.44 rows=844 width=40) (actual rows= loops=)

5.          

CTE attributes

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4,767.81..10,402.54 rows=373,048 width=116) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Seq Scan on discover_seed_rollup s (cost=0.00..22.44 rows=844 width=24) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Materialize (cost=4,767.81..4,785.49 rows=442 width=78) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=4,767.81..4,778.86 rows=442 width=78) (actual rows= loops=)

  • Group Key: discover_raw.company_id, discover_raw.consumed_resource_uri, discover_raw.consumption_type, discover_raw.id_type
10. 0.000 0.000 ↓ 0.0

Sort (cost=4,767.81..4,768.91 rows=442 width=64) (actual rows= loops=)

  • Sort Key: discover_raw.company_id, discover_raw.consumed_resource_uri, discover_raw.consumption_type, discover_raw.id_type
11. 0.000 0.000 ↓ 0.0

Hash Anti Join (cost=40.60..4,748.39 rows=442 width=64) (actual rows= loops=)

  • Hash Cond: (discover_raw.consumed_resource_uri = b.consumed_resource_uri)
12. 0.000 0.000 ↓ 0.0

Seq Scan on discover_raw (cost=0.00..4,625.96 rows=884 width=64) (actual rows= loops=)

  • Filter: (raw_count > 2000)
13. 0.000 0.000 ↓ 0.0

Hash (cost=23.60..23.60 rows=1,360 width=32) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Seq Scan on blacklist b (cost=0.00..23.60 rows=1,360 width=32) (actual rows= loops=)

15.          

CTE temp

16. 0.000 0.000 ↓ 0.0

Hash Join (cost=51.70..10,455.07 rows=176 width=201) (actual rows= loops=)

  • Hash Cond: (s_1.company_id = company_counts.company_id)
17. 0.000 0.000 ↓ 0.0

Hash Join (cost=0.07..10,259.08 rows=19 width=248) (actual rows= loops=)

  • Hash Cond: ((t_1.report_id = s_1.report_id) AND (t_1.company_id = s_1.company_id))
18. 0.000 0.000 ↓ 0.0

CTE Scan on attributes t_1 (cost=0.00..7,460.96 rows=373,048 width=200) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Hash (cost=0.04..0.04 rows=2 width=80) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

CTE Scan on company_seed s_1 (cost=0.00..0.04 rows=2 width=80) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Hash (cost=28.50..28.50 rows=1,850 width=16) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Seq Scan on company_counts (cost=0.00..28.50 rows=1,850 width=16) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

CTE Scan on temp t (cost=0.00..3.52 rows=176 width=201) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Hash (cost=1.02..1.02 rows=2 width=72) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Seq Scan on report_info r (cost=0.00..1.02 rows=2 width=72) (actual rows= loops=)