Re: how to change the index chosen in plan?

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

 



Rural Hunter <ruralhunter@xxxxxxxxx> writes:
> I have a query like this:
> select a.* from a inner join b on a.aid=b.aid where a.col1=33 a.col2=44 
> and b.bid=8
> postgresql selected the index on a.col1 then selected the index on 
> b.bid. But in my situation, I know that the query will be faster if it 
> chose the index on b.bid first since there are only a few rows with 
> value 8.

If you know that and the planner doesn't, maybe ANALYZE is called for.

			regards, tom lane

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


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux