Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 42EDBF6498F for ; Tue, 24 Jul 2012 12:55:41 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SthSW-0002nC-Ey for pgsql-performance@postgresql.org; Tue, 24 Jul 2012 15:55:40 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q6OFtP6o022820; Tue, 24 Jul 2012 11:55:25 -0400 (EDT) From: Tom Lane To: Thomas Kellerer cc: pgsql-performance@postgresql.org Subject: Re: Using ctid column changes plan drastically In-reply-to: References: <21308.1343139781@sss.pgh.pa.us> Comments: In-reply-to Thomas Kellerer message dated "Tue, 24 Jul 2012 16:54:18 +0200" Date: Tue, 24 Jul 2012 11:55:25 -0400 Message-ID: <22819.1343145325@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/304 X-Sequence-Number: 47485 Thomas Kellerer writes: > Tom Lane, 24.07.2012 16:23: >> IIRC, type tid doesn't have any hash support. > So the "bad" plan is expected? Joins on tid columns just aren't supported very well at the moment. Partly that's from lack of round tuits, and partly it's because it doesn't seem all that wise to encourage people to use them. There are gotchas if any of the rows receive concurrent updates. FWIW, it might be helpful to cast this as a NOT EXISTS rather than NOT IN subquery. regards, tom lane