X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6D77EDAF62 for ; Wed, 26 Oct 2005 20:22:17 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 38939-04 for ; Wed, 26 Oct 2005 23:22:11 +0000 (GMT) Received: from cassarossa.samfundet.no (cassarossa.samfundet.no [129.241.93.19]) by svr1.postgresql.org (Postfix) with ESMTP id 60F11DAFA7 for ; Wed, 26 Oct 2005 20:22:13 -0300 (ADT) Received: from trofast.sesse.net ([129.241.93.32]) by cassarossa.samfundet.no with esmtp (Exim 4.50) id 1EUub0-0007KW-Fs for pgsql-performance@postgresql.org; Thu, 27 Oct 2005 01:22:15 +0200 Received: from sesse by trofast.sesse.net with local (Exim 3.36 #1 (Debian)) id 1EUub6-0001pO-00 for ; Thu, 27 Oct 2005 01:22:20 +0200 Date: Thu, 27 Oct 2005 01:22:19 +0200 From: "Steinar H. Gunderson" To: pgsql-performance@postgresql.org Subject: Re: Materializing a sequential scan Message-ID: <20051026232219.GA6390@uio.no> Mail-Followup-To: pgsql-performance@postgresql.org References: <20051019174544.GA32303@samfundet.no> <20051026213730.GA2295@uio.no> <12333.1130367975@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <12333.1130367975@sss.pgh.pa.us> X-Operating-System: Linux 2.6.14-rc5 on a x86_64 X-Message-Flag: Outlook? --> http://www.mozilla.org/products/thunderbird/ User-Agent: Mutt/1.5.11 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.01 required=5 tests=[AWL=0.010] X-Spam-Level: X-Archive-Number: 200510/402 X-Sequence-Number: 15170 On Wed, Oct 26, 2005 at 07:06:15PM -0400, Tom Lane wrote: > AFAICS, subplan_is_hashable() is testing the same conditions in 7.4 and > HEAD, so this isn't clear. Want to step through it and see where it's > deciding not to hash? Line 639, ie.: 635 if (!optup->oprcanhash || optup->oprcom != opid || 636 !func_strict(optup->oprcode)) 637 { 638 ReleaseSysCache(tup); 639 return false; 640 } gdb gives (gdb) print *optup $2 = {oprname = { data = "\220Ü2\b\000\000\000\000\000\000\000\000\005\230-\b", '\0' , "X\0305\b\020\000\000\000\000\000\000\000ئ>\b\020\000\000\000\000\000\000\000ð\213>\b\020\000\000", alignmentDummy = 137550992}, oprnamespace = 137542808, oprowner = 64, oprkind = 8 '\b', oprcanhash = -112 '\220', oprleft = 2, oprright = 0, oprresult = 0, oprcom = 0, oprnegate = 0, oprlsortop = 0, oprrsortop = 0, oprltcmpop = 0, oprgtcmpop = 0, oprcode = 0, oprrest = 0, oprjoin = 0} (gdb) print opid $3 = 2373 So it's complaining about the optup->oprcom != opid part. This is of course on the third run through the loop, ie. it's complaining about the argument which is run through the function kortsys2.effektiv_dato(date)... For convenience, I've listed it again here: CREATE FUNCTION kortsys2.effektiv_dato(date) RETURNS date AS 'SELECT CASE WHEN $1 < CURRENT_DATE THEN CURRENT_DATE ELSE $1 END' LANGUAGE SQL STABLE; /* Steinar */ -- Homepage: http://www.sesse.net/