explain.depesz.com

PostgreSQL's explain analyze made readable

Result: v0wt

Settings
# exclusive inclusive rows x rows loops node
1. 20.732 9,296.957 ↓ 1.1 6,955 1

Nested Loop (cost=29.55..1,746,924.86 rows=6,361 width=366) (actual time=1.702..9,296.957 rows=6,955 loops=1)

2. 8.047 26.075 ↓ 1.1 6,955 1

Nested Loop (cost=29.55..1,045.38 rows=6,361 width=1,071) (actual time=0.199..26.075 rows=6,955 loops=1)

3. 4.545 11.073 ↓ 1.1 6,955 1

Hash Left Join (cost=29.55..918.16 rows=6,361 width=1,233) (actual time=0.193..11.073 rows=6,955 loops=1)

  • Hash Cond: (pb.id = pbd.parent_brand_id)
4. 6.369 6.369 ↓ 1.1 6,955 1

Seq Scan on parent_brands pb (cost=0.00..855.89 rows=6,361 width=696) (actual time=0.005..6.369 rows=6,955 loops=1)

  • Filter: ((status <> 'Pending'::text) OR (created_by_company_id = '224629d9-701d-48f4-9b75-051c1ca4a382'::uuid))
  • Rows Removed by Filter: 38
5. 0.063 0.159 ↑ 1.0 97 1

Hash (cost=28.30..28.30 rows=100 width=553) (actual time=0.159..0.159 rows=97 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 64kB
6. 0.096 0.096 ↑ 1.0 97 1

Seq Scan on parent_brand_drafts pbd (cost=0.00..28.30 rows=100 width=553) (actual time=0.002..0.096 rows=97 loops=1)

  • Filter: ((status = 'Pending'::text) AND (updated_by_company_id = '224629d9-701d-48f4-9b75-051c1ca4a382'::uuid))
  • Rows Removed by Filter: 126
7. 6.955 6.955 ↑ 1.0 1 6,955

Function Scan on adv_ids (cost=0.00..0.01 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=6,955)

8. 6.955 6.955 ↑ 1.0 1 6,955

Function Scan on cat_ids (cost=0.00..0.01 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=6,955)

9.          

SubPlan (for Nested Loop)

10. 27.820 1,495.325 ↑ 1.0 1 6,955

Aggregate (cost=41.43..41.44 rows=1 width=32) (actual time=0.215..0.215 rows=1 loops=6,955)

11. 1,467.505 1,467.505 ↑ 2.0 1 6,955

Seq Scan on advertisers adv (cost=0.00..41.42 rows=2 width=26) (actual time=0.161..0.211 rows=1 loops=6,955)

  • Filter: (adv_ids.adv_ids @> ARRAY[(id)::text])
  • Rows Removed by Filter: 369
12. 62.595 7,747.870 ↑ 1.0 1 6,955

Aggregate (cost=232.98..232.99 rows=1 width=32) (actual time=1.114..1.114 rows=1 loops=6,955)

13. 6.955 7,685.275 ↑ 11.0 1 6,955

Nested Loop Left Join (cost=0.56..232.87 rows=11 width=216) (actual time=0.780..1.105 rows=1 loops=6,955)

14. 6.955 7,678.320 ↑ 11.0 1 6,955

Nested Loop Left Join (cost=0.28..227.18 rows=11 width=160) (actual time=0.779..1.104 rows=1 loops=6,955)

15. 7,671.365 7,671.365 ↑ 11.0 1 6,955

Seq Scan on categories childcategory (cost=0.00..147.90 rows=11 width=88) (actual time=0.778..1.103 rows=1 loops=6,955)

  • Filter: (cat_ids.cat_ids @> ARRAY[(id)::text])
  • Rows Removed by Filter: 2225
16. 0.000 0.000 ↓ 0.0 0 3,699

Index Scan using categories_pkey on categories parentcategory (cost=0.28..7.21 rows=1 width=88) (actual time=0.000..0.000 rows=0 loops=3,699)

  • Index Cond: (childcategory.parent_id = id)
17. 0.000 0.000 ↓ 0.0 0 3,699

Index Scan using categories_pkey on categories grandparentcategory (cost=0.28..0.52 rows=1 width=72) (actual time=0.000..0.000 rows=0 loops=3,699)

  • Index Cond: (parentcategory.parent_id = id)
Planning time : 1.823 ms
Execution time : 9,298.081 ms