This line from the EXPLAIN output suggests that the rule is causing a seq scan
to be used instead on an index scan:

... WHERE ... a.archiveset = new.archiveset AND a.fileid <> new.fileid.

When I replace the "new." with actual integers:

  ... WHERE ...   a.archiveset = 10003 AND a.fileid <>  35352974,

the problem goes away.

That makes me think that the planner is unable to find the index, so it instead
uses a seq scan.

I still don't have find any good suggestion.
If the cause by the key word "new" or "old" in the rule, the planner is confused which index to use. I think this is should be considered as a bug for rule system related to planner. I am not sure 9.2 will address this issue.

--
Best regards,


Alex Lai
OMI SIPS DBA ADNET Systems , Inc.
7515 Mission Drive,
Suite A100 Lanham, MD 20706
301-352-4657 (phone)
301-352-0437 (fax)
a...@sesda2.com



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to