X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id DA5E09DC955 for ; Sat, 11 Feb 2006 18:43:12 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 71479-03 for ; Sat, 11 Feb 2006 18:43:14 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from outbound.internet-mail-service.net (outbound6.internet-mail-service.net [216.240.47.197]) by postgresql.org (Postfix) with ESMTP id CD6779DC94D for ; Sat, 11 Feb 2006 18:43:10 -0400 (AST) Received: from idiom.com (idiom.com [216.240.32.1]) by outbound.internet-mail-service.net (Postfix) with ESMTP id AFB7324039C; Sat, 11 Feb 2006 14:43:12 -0800 (PST) Received: from [192.168.1.109] (adsl-69-107-112-198.dsl.pltn13.pacbell.net [69.107.112.198]) by idiom.com (8.12.11/8.12.11) with ESMTP id k1BMhBfj073408; Sat, 11 Feb 2006 14:43:11 -0800 (PST) (envelope-from bryce1@obviously.com) Message-ID: <43EE6877.7080002@obviously.com> Date: Sat, 11 Feb 2006 14:43:03 -0800 From: Bryce Nesbitt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050921 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org CC: Peter Eisentraut Subject: Re: Very slow updates when using IN syntax subselect References: <43ECFF0B.80905@obviously.com> <7972.1139672862@sss.pgh.pa.us> <43EE3F77.6020108@obviously.com> <200602112134.57572.peter_e@gmx.net> In-Reply-To: <200602112134.57572.peter_e@gmx.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.113 required=5 tests=[AWL=0.113] X-Spam-Score: 0.113 X-Spam-Level: X-Archive-Number: 200602/126 X-Sequence-Number: 24136 Peter Eisentraut wrote: > Bryce Nesbitt wrote: > >>> It seems pretty clear that you've never vacuumed nor analyzed these >>> tables ... else the planner would have some clue about their sizes. >>> Do that and then see what you get. >>> >> They occur in fine time. That's good, thanks. But jeeze, can't >> postgres figure this out for itself? >> > > I'm sure you wouldn't appreciate it if PostgreSQL did a full table scan > before each query to figure out the total size of the involved tables. > Nope. But let's say the query optimizer thought the table had one row. The the query starts, and 111,000 rows later... It seems that a mismatch between the static table size, and the actual one counted as you go, would be a quick check. That could set a flag for later background processing.... -Bryce