Search Postgresql Archives

Re: Nested Loop Left Join always shows rows=1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tom Lane wrote:
Scara Maccai <m_lists@xxxxxxxx> writes:
-> 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.

Why is the index condition redundant? I guess the redundant part is

"AND (tab1.id = tab_outer.out_id)" but I'm not sure, and I would really appreciate if you could explain a little bit more...

The reason I'm asking is because I'm looking at the implementation of some VERY basic form of progress indicator based on "estimated rows vs rows already processed".
I guess this would work for our DB because the planner is usually very good at guessing the number of rows for each step of the plan, since our distributions are pretty simple.

But this left outer join thing I'm afraid would invalidate the method, since the inner table row count is always off...



Thank you for the reply.

(I added hackers too, since this seems a place where some fixing/development would be necessary. I hope it's ok.)




--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux