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 2313CDAFAB for ; Wed, 26 Oct 2005 20:53:05 -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 44426-08 for ; Wed, 26 Oct 2005 23:53:01 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 67967DAF7B for ; Wed, 26 Oct 2005 20:53:03 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j9QNr21U012709; Wed, 26 Oct 2005 19:53:02 -0400 (EDT) To: "Steinar H. Gunderson" Cc: pgsql-performance@postgresql.org Subject: Re: Materializing a sequential scan In-reply-to: <20051026232219.GA6390@uio.no> References: <20051019174544.GA32303@samfundet.no> <20051026213730.GA2295@uio.no> <12333.1130367975@sss.pgh.pa.us> <20051026232219.GA6390@uio.no> Comments: In-reply-to "Steinar H. Gunderson" message dated "Thu, 27 Oct 2005 01:22:19 +0200" Date: Wed, 26 Oct 2005 19:53:02 -0400 Message-ID: <12708.1130370782@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200510/404 X-Sequence-Number: 15172 "Steinar H. Gunderson" writes: > 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? > (gdb) print opid > $3 = 2373 I don't think you're getting a correct reading for optup, but OID 2373 is timestamp = date: regression=# select * from pg_operator where oid = 2373; oprname | oprnamespace | oprowner | oprkind | oprcanhash | oprleft | oprright | oprresult | oprcom | oprnegate | oprlsortop | oprrsortop | oprltcmpop | oprgtcmpop | oprcode | oprrest | oprjoin ---------+--------------+----------+---------+------------+---------+----------+-----------+--------+-----------+------------+------------+------------+------------+-------------------+---------+----------- = | 11 | 10 | b | f | 1114 | 1082 | 16 | 2347 | 2376 | 2062 | 1095 | 2371 | 2375 | timestamp_eq_date | eqsel | eqjoinsel (1 row) which is marked not hashable, quite correctly since the input datatypes aren't even the same. My recollection is that there was no such operator in 7.4; probably in 7.4 the IN ended up using timestamp = timestamp which is hashable. What's not clear though is why you're getting that operator --- aren't both sides of the IN of type "date"? regards, tom lane