Re: cannot use multicolumn index

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

 



On Wed, Sep 14, 2011 at 6:50 AM, MirrorX <mirrorx@xxxxxxxxx> wrote:
> dear all,
>
> i have a table with (approx) 500.000.000 rows. it has several indexes, one
> of which is a multicolumn index
> for a column that has an id (integer) and a column that has a timestamp. i
> have read in the manual that the multicolumn index can be used only if the
> clauses of the query are in the same order as the columns of the index. so i
> am trying the following simple query ->

this is incorrect.  Where did you read this?  The order in the where
clause doesn't matter.  Older versions of pg cannot use a muilticolumn
index unless you use the first column in the where clause / group by,
but newer versions can use that index, but since it's much less
efficient that way they will usually pick another index with the other
column in it first.

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