Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id A737D9F9AD7 for ; Sun, 19 Nov 2006 03:28:23 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 62525-06 for ; Sun, 19 Nov 2006 03:28:20 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id B9B2E9F94EA for ; Sun, 19 Nov 2006 03:28:15 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id kAJ7S28v006252; Sun, 19 Nov 2006 02:28:02 -0500 (EST) To: postgresql-ctennant@elirious.com cc: pgsql-sql@postgresql.org Subject: Re: planner used functional index in 7.3.6, now does a seq scan in 7.4.7 after upgrade In-reply-to: <455FF56D.7030001@elirious.com> References: <455FF56D.7030001@elirious.com> Comments: In-reply-to Chris Tennant message dated "Sat, 18 Nov 2006 22:10:53 -0800" Date: Sun, 19 Nov 2006 02:28:01 -0500 Message-ID: <6251.1163921281@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/205 X-Sequence-Number: 26857 Chris Tennant writes: > here's the definition of the function (as immutable): > CREATE OR REPLACE FUNCTION stereo_id (INTEGER, INTEGER, INTEGER) RETURNS > INTEGER AS > 'BEGIN RETURN CASE WHEN $2 = $3 THEN $1 ELSE -1 END; END;' > LANGUAGE 'plpgsql' IMMUTABLE; > and here's the original definition of the functional index: > CREATE INDEX stereo_pair_image_attributes_stereo_id > ON opt_stereo_pair_image_attributes > (stereo_id(right_patient_data_id,left_patient_data_id)); Um, that index seems to be on some other function that may have the same name, but only takes two arguments? regards, tom lane