Can you give an example query and explain output for both cases?
Have you run vacuum analyze?
Since I haven't seen the query, one thing that might bite you would
be if you aren't casting your constants to smallint, although I
don't know why that would change on the index definition.
On 6 Nov 2001, charles wrote:
> the table has about 30k records.
> simple select statement, by primary key, requires plenty of cpu
> time when the primary key has three columns
> when the primary key has two columns several times less cpu is
> required (even though the contents of the table is the same.
>
> so:
> PRIMARY KEY(C_ID, C_D_ID, C_W_ID) -> PRIMARY KEY (C_ID, C_D_ID)
> select cpu: 600 -> select cpu 60
>