Search Postgresql Archives

Re: Index non-usage problem in 8.2.9

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

 



Joseph S <jks@xxxxxxxxxxxxxxx> writes:
> Actually sacode is an int2.

Ah.  8.2 is not very good at proving cross-type predicate conditions,
because it lacks the concept of an operator family.  You need to declare
the index this way:

create index d2i on d2 (sgcode, sacode)
  WHERE sacode IS NOT NULL AND sacode > 0::int2;

(As previously noted, you don't really need the IS NOT NULL part of the
condition, but that isn't what's causing the problem here.)

			regards, tom lane


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux