Re: [EXPLAIN] Nested loops

From: Reg Me Please <regmeplease(at)gmail(dot)com>
To: thomas(dot)pundt(at)rp-online(dot)de
Cc: pgsql-general(at)postgresql(dot)org, Victor Nawothnig <victor(dot)nawothnig(at)gmail(dot)com>
Subject: Re: [EXPLAIN] Nested loops
Date: 2009-01-09 19:27:10
Message-ID: 200901092027.11142.regmeplease@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Friday 09 January 2009 20:00:36 Thomas Pundt wrote:
> Reg Me Please wrote:
> > Here it comes:
> >
> > Aggregate (cost=227.59..227.61 rows=1 width=8)
> > -> Nested Loop (cost=0.00..227.34 rows=49 width=8)
> > -> Seq Scan on T2 (cost=0.00..1.07 rows=6 width=4)
> > Filter: (fld1 = 'VEND'::text)
> > -> Index Scan using i_T1_partial on T1 (cost=0.00..37.61
> > rows=8 width=8)
> > Index Cond: ((T1.prod_id = 42) AND (T1.fk1 = T2.fk1))
>
> That's the EXPLAIN output, _not_ EXPLAIN ANALYZE as requested.
>
> Probably statistics aren't up-to-date?
>
> Thomas

Correct!
I changed a value in the WHERE condition to avoid some caching (maybe useless
in this case).

QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Aggregate (cost=227.59..227.61 rows=1 width=8) (actual time=151.722..151.723
rows=1 loops=1)
-> Nested Loop (cost=0.00..227.34 rows=49 width=8) (actual
time=25.157..151.507 rows=44 loops=1)
-> Seq Scan on T2 (cost=0.00..1.07 rows=6 width=4) (actual
time=0.015..0.032 rows=6 loops=1)
Filter: (fld1 = 'VEND'::text)
-> Index Scan using i_T1_partial on T1 (cost=0.00..37.61 rows=8
width=8) (actual time=5.435..25.226 rows=7 loops=6)
Index Cond: ((T1.prod_id = 4242) AND (T1.fk1 = T2.fk1))
Total runtime: 151.818 ms
(7 rows)


--
Fahrbahn ist ein graues Band
weisse Streifen, grüner Rand

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Reg Me Please 2009-01-09 19:27:25 Re: [EXPLAIN] Nested loops
Previous Message Simon Riggs 2009-01-09 19:19:13 Re: Improving compressibility of WAL files