Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 277541337BC2 for ; Fri, 11 Mar 2011 11:32:18 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 80491-10 for ; Fri, 11 Mar 2011 15:32:09 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22]) by mail.postgresql.org (Postfix) with SMTP id 3B9BA1337B61 for ; Fri, 11 Mar 2011 11:32:08 -0400 (AST) Received: (qmail 27748 invoked by uid 0); 11 Mar 2011 15:32:08 -0000 Received: from 217.91.105.163 by www019.gmx.net with HTTP; Fri, 11 Mar 2011 16:32:05 +0100 (CET) Content-Type: text/plain; charset="utf-8" Date: Fri, 11 Mar 2011 16:32:05 +0100 From: "hans wulf" Message-ID: <20110311153205.6380@gmx.net> MIME-Version: 1.0 Subject: ANTI-JOIN needs table, index scan not possible? To: pgsql-performance@postgresql.org X-Authenticated: #18544190 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX1/qQvdCmKbqLkFQbE8PnNo2YBYizoFruLCIc3uC1p 0wJ6PwjuyFtPPFQR0QDXpLTDCkLLrRpp813w== Content-Transfer-Encoding: 8bit X-GMX-UID: QnhMfEwxYmYBWAjBf3Y3SABCWkZTQdTd X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.346 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=1.553, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, T_RP_MATCHES_RCVD=-0.01, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201103/118 X-Sequence-Number: 42797 Hi, I need an ANTI-JOIN (not exists SELECT something from table.../ left join table WHERE table.id IS NULL) on the same table. Acutally I have an index to serve the not exists question, but the query planner chooses to to a bitmap heap scan. The table has 100 Mio rows, so doing a heap scan is messed up... It would be really fast if Postgres could compare the to indicies. Does Postgres have to visit the table for this ANTI-JOIN? I know the table has to be visitied at some point to serve the MVCC, but why so early? Can NOT ESISTS only be fixed by the table, because it could miss soemthing otherwise? -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de