X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 9D5F59DCBC1 for ; Fri, 10 Mar 2006 07:53:05 -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 48230-07 for ; Fri, 10 Mar 2006 07:53:08 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.rentalia.net (mail.rentalia.com [213.192.209.8]) by postgresql.org (Postfix) with ESMTP id DE4599DC9DC for ; Fri, 10 Mar 2006 07:53:01 -0400 (AST) Received: (qmail 15192 invoked by uid 514); 10 Mar 2006 12:49:32 +0100 Received: from 62.37.216.137 by rigodon (envelope-from , uid 512) with qmail-scanner-1.25-st-qms (clamdscan: 0.88/1284. spamassassin: 3.0.2. perlscan: 1.25-st-qms. Clear:RC:0(62.37.216.137):SA:0(-2.0/5.0):. Processed in 1.862776 secs); 10 Mar 2006 11:49:32 -0000 X-Antivirus-MYDOMAIN-Mail-From: ruben@rentalia.com via rigodon X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:0(62.37.216.137):SA:0(-2.0/5.0):. Processed in 1.862776 secs Process 15064) Received: from 62-37-216-137.mad1.adsl.uni2.es (HELO ?192.168.2.28?) (ruben@rentalia.com@62.37.216.137) by mail.rentalia.net with SMTP; 10 Mar 2006 12:49:30 +0100 Message-ID: <44116889.80804@rentalia.com> Date: Fri, 10 Mar 2006 12:52:41 +0100 From: Ruben Rubio Rey User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051011) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Query time References: <44114F85.8020702@rentalia.com> <20060310104826.GA14532@winnie.fuhr.org> In-Reply-To: <20060310104826.GA14532@winnie.fuhr.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.103 required=5 tests=[AWL=0.103] X-Spam-Score: 0.103 X-Spam-Level: X-Archive-Number: 200603/120 X-Sequence-Number: 17557 Michael Fuhr wrote: >On Fri, Mar 10, 2006 at 11:05:57AM +0100, Ruben Rubio Rey wrote: > > >>Sometimes some big query takes between 5 to 15 seconds. It happens >>sometimes all the day it does not depend if database is busy. >> >>I have measured that sentence in 15 - 70 ms in normal circunstances. >> >> > >Is it the *exact* same query, including the values you're querying >for? The same query with different values can run with different >plans depending on row count estimates. It might be useful to see >the query string and the EXPLAIN ANALYZE output for a fast query >and a slow one. > >How many tables are you querying? Might you be hitting geqo_threshold >(default 12)? If so then the following thread might be helpful: > >http://archives.postgresql.org/pgsql-performance/2006-01/msg00132.php > > > The querys that are failing are very similar. But, when I see the warning in logs files, I take that query and try it, and takes a few miliseconds (as spected). That query one table on FROM and 2 or 3 on WHERE clause. Rigth now Im using the default server configuration for geqo_threshold, but i'll ckeck the link that u provide me.