Re: Nested Loop Left Join always shows rows=1 - Mailing list pgsql-general

From Tom Lane
Subject Re: Nested Loop Left Join always shows rows=1
Date
Msg-id 11492.1227822563@sss.pgh.pa.us
Whole thread Raw
In response to Nested Loop Left Join always shows rows=1  (Scara Maccai <m_lists@yahoo.it>)
Responses Re: Nested Loop Left Join always shows rows=1  (Scara Maccai <m_lists@yahoo.it>)
List pgsql-general
Scara Maccai <m_lists@yahoo.it> writes:
>   Aggregate  (cost=31.91..31.92 rows=1 width=4) (actual
> time=14.185..14.185 rows=1 loops=1)
>     ->  Nested Loop Left Join  (cost=0.00..17.11 rows=2959 width=4)
> (actual time=8.608..13.400 rows=2953 loops=1)
>           ->  Index Scan using id_idx on tab1  (cost=0.00..8.27 rows=1
> width=4) (actual time=0.010..0.011 rows=1 loops=1)
>                 Index Cond: (id = 10)
>           ->  Index Scan using out_id_idx on tab_outer  (cost=0.00..8.83
> rows=1 width=8) (actual time=8.590..11.924 rows=2953 loops=1)
>                 Index Cond: ((tab_outer.out_id = 10) AND (tab1.id =
> tab_outer.out_id))

This seems a bit broken :-( ... ideally it shouldn't be generating the
redundant index condition, either.  I think the redundant condition is
probably indirectly responsible for the low rowcount estimate, too.
It doesn't really hurt anything, since the join output estimate is
correct, but it'd be nice to make it look better.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Expected password response, got message type 88
Next
From: Bill Todd
Date:
Subject: Re: COPY with a variable path