The Hermit Hacker <scrappy@hub.org> writes:
> Now, something does bother me here, and I'm not sure if its a problem we
> need to address, or if its expected, but if I remove the index
> aecwebentry_divid, it reverts to using aecwebentry_primary and increases
> the query time to 12secs, which is:
> create unique index aecWebEntry_primary on aecWebEntry ( indid,divid,catid,id,mid);
> Should it do that?
Yeah, that does seem odd. The other way is presumably visiting the
aecwebentry tuples in a different order (the one induced by the other
index), but I don't see why that should produce a 10:1 difference in
runtime.
Can you send me the EXPLAIN VERBOSE output for the query with and
without the extra index? (Preferably the prettyprinted version from
the postmaster log file, not what comes out as a NOTICE...)
Also, I assume you found that merge or hash join wasn't any better?
regards, tom lane