[PERFORM] planner doesn't use multicolumn index

2003-10-08 Thread Adrian Demaestri
We've a table with about 8 million rows, and we need to get rows by the value of two of its fields( the type of the fields are int2 and int4, the where condition is v.g. partido=99 and partida=123). We created a multicolumn index on that fields but the planner doesn't use it, it still use a seqscan. That fields are primary key of the table and we clusterded the table based on that index, but it still doesn't work. We also set the enviroment variable enable_seqscan to false and nathing happends. The only way the planner use it is in querys that order by the _expression_ of the index.
Any idea?
thanks.
AdriánDo You Yahoo!?

Todo lo que quieres saber de Estados Unidos, América Latina y el resto del Mundo.
Visíta Yahoo! Noticias.

Re: [PERFORM] planner doesn't use multicolumn index

2003-10-08 Thread Tomasz Myrta
We've a table with about 8 million rows, and we need to get rows by the 
value of two of its fields( the type of the fields are int2 and int4, 
the where condition is v.g. partido=99 and partida=123). We created a 
multicolumn index on that fields but the planner doesn't use it, it 
still use a seqscan. That fields are primary key of the table and we 
clusterded the table based on that index, but it still doesn't work. We 
also set the enviroment variable enable_seqscan to false and nathing 
happends. The only way the planner use it is in querys that order by the 
expression of the index.
Any idea?
thanks.
Adrián
where partido=99::int2 and partida=123;

Regards,
Tomasz Myrta
---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
 joining column's datatypes do not match


Re: [PERFORM] planner doesn't use multicolumn index

2003-10-08 Thread Shridhar Daithankar
Adrian Demaestri wrote:

We've a table with about 8 million rows, and we need to get rows by the value 
>of two of its fields( the type of the fields are int2 and int4,
the where condition is v.g. partido=99 and partida=123). We created a
>multicolumn index on that fields but the planner doesn't use it, it still use
>a seqscan. That fields are primary key of the table and we clusterded the table
>based on that index, but it still doesn't work. We also set the enviroment
> variable enable_seqscan to false and nathing happends. The only way the
>planner use it is in querys that order by the expression of the index.
Use partido=99::int2 and partida=123::int4

Match the data types basically..

 Shridhar

---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [PERFORM] planner doesn't use multicolumn index

2003-10-08 Thread Manfred Koizar
On Wed, 8 Oct 2003 09:08:59 -0500 (CDT), Adrian Demaestri
<[EMAIL PROTECTED]> wrote:
>the type of the fields are int2 and
>int4, the where condition is v.g. partido=99 and partida=123).

Write your search condition as

WHERE partido=99::int2 and partida=123

Servus
 Manfred

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])