Query is:

"explain analyze select sum(A), count(*) from tab1 left outer join tab_outer on id=out_id where id=10;"

output:

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))



http://explain-analyze.info/query_plans/2519-query-plan-1240

I ran ANALYZE on both tables, but the plan shows rows=1 in the inner table results.

If I change the "left outer join" into an "inner join" the bitmap index scan of the inner table of the nested loop shows a correct number of rows (not the exact same thing as "actual rows", but very close).

Am I reading the explain output in the wrong way?
I'm not complaining about performance issues, I'm just trying to learn how to read plans.





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

Reply via email to