Re: [HACKERS] Wrong plan for simple join with index on FK

2006-05-16 Thread Pavel Stehule
> >These are all minor abberations though, on the whole the estimates are > >pretty good. Perhaps you need to tweak the values of random_page_cost > >and similar variables. > > Thank You, It's general problem or only mine? I have "100%" > standard current PC. The default random_page_cost assum

Re: [HACKERS] Wrong plan for simple join with index on FK

2006-05-16 Thread Zeugswetter Andreas DCP SD
> >These are all minor abberations though, on the whole the estimates are > >pretty good. Perhaps you need to tweak the values of random_page_cost > >and similar variables. > > Thank You, It's general problem or only mine? I have "100%" > standard current PC. The default random_page_cost assume

Re: [HACKERS] Wrong plan for simple join with index on FK

2006-05-16 Thread Pavel Stehule
These are all minor abberations though, on the whole the estimates are pretty good. Perhaps you need to tweak the values of random_page_cost and similar variables. Thank You, It's general problem or only mine? I have "100%" standard current PC. Pavel ___

Re: [HACKERS] Wrong plan for simple join with index on FK

2006-05-16 Thread Martijn van Oosterhout
On Tue, May 16, 2006 at 12:54:58PM +0200, Pavel Stehule wrote: > > > >Can we seen an EXPLAIN ANALYZE output to see where the miscalculation > >lies. Is it underestimating the cost of the index scan, or > >overestimating the cost of the hash join. > postgres=> explain analyze select count(*) from f

Re: [HACKERS] Wrong plan for simple join with index on FK

2006-05-16 Thread Pavel Stehule
Can we seen an EXPLAIN ANALYZE output to see where the miscalculation lies. Is it underestimating the cost of the index scan, or overestimating the cost of the hash join. postgres=> explain analyze select count(*) from f1 join f2 on pk=fk;

Re: [HACKERS] Wrong plan for simple join with index on FK

2006-05-16 Thread Martijn van Oosterhout
On Tue, May 16, 2006 at 11:52:05AM +0200, Pavel Stehule wrote: > Hello > > I test using index on foreign key. I found situation, when planner choose > worse plan. Can we seen an EXPLAIN ANALYZE output to see where the miscalculation lies. Is it underestimating the cost of the index scan, or over