Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 12AEB65019B for ; Tue, 2 Dec 2008 06:10:20 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 21694-08 for ; Tue, 2 Dec 2008 06:10:17 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gx0-f19.google.com (mail-gx0-f19.google.com [209.85.217.19]) by mail.postgresql.org (Postfix) with ESMTP id 91E38650030 for ; Tue, 2 Dec 2008 06:10:16 -0400 (AST) Received: by gxk12 with SMTP id 12so1652040gxk.19 for ; Tue, 02 Dec 2008 02:10:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=HnIZLRN/K95bo+nJP+hW8wb98nJuUDM2EEKjofMtzkc=; b=dKl5n/UabsT2Qoz/xa0jDR872gHnniw7RvuZgUqZxWzWGVqyJuwmAUzvo7/BcuW+wb 4V3WAC8I1VNb0ne91ia21G7Q+xt+yCdaYaYWJyZeQiMHB8aXr0lskb0HkNFIwSFX6Dbm i24AuaBEIvOIwFHkGmNVGLzVDM2NuoDwEdhSc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=FIvaGVPtPivyOoMRobk0NH9l89/cfnFvSyJYssPooDaAxcnQ08x2Sif+w/+2io22yu 3IoXmRs8AY2senjRVoE6ZhSA+N93bkJnkFbwfX5Njv5CooPCLJVSr8R/lL3D3FK+Ja99 BwDJdqRjbxWjsBu+v30g63tn8EyF03qousbzo= Received: by 10.151.111.1 with SMTP id o1mr13743402ybm.225.1228212614849; Tue, 02 Dec 2008 02:10:14 -0800 (PST) Received: by 10.151.106.1 with HTTP; Tue, 2 Dec 2008 02:10:14 -0800 (PST) Message-ID: <48d0cacb0812020210s22d44b84nc0a6719c97502e87@mail.gmail.com> Date: Tue, 2 Dec 2008 08:10:14 -0200 From: "Daniel Cristian Cruz" To: pgsql-admin Subject: Re: Not so simple query and a half million loop In-Reply-To: <48d0cacb0812010721t783bdcd9g36090504b7070a06@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48d0cacb0812010526i7c51b29fs9319618b3aaf3f49@mail.gmail.com> <48d0cacb0812010721t783bdcd9g36090504b7070a06@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200812/9 X-Sequence-Number: 30842 No one knows why I got "actual time=0.014..0.570 rows=30 loops=511222" and "actual time=0.005..0.006 rows=1 loops=15158976"? With: cu.cal_user_type = 'u' AND cu.cal_recur_date = COALESCE((SELECT cd.cal_start FROM egw_cal_dates icd WHERE icd.cal_id = cd.cal_id AND icd.cal_start = cd.cal_start AND icd.cal_start <> 0), 0) ~ 450 seconds With cu.cal_user_type = 'u' ~ 130 ms With cu.cal_recur_date = COALESCE((SELECT cd.cal_start FROM egw_cal_dates icd WHERE icd.cal_id = cd.cal_id AND icd.cal_start = cd.cal_start AND icd.cal_start <> 0), 0) ~ 1 second I've tryied to increase statistics to maximum, with no success. This is the eGroupware database schema, with a few records. Regards, 2008/12/1 Daniel Cristian Cruz : > Maybe someone would like to see it without broken lines (I do). > > Regards, > > 2008/12/1 Daniel Cristian Cruz : >> I've tryied 4 times to post this message to pgsql-performance without >> success... No return, even an error... >> >> Below is my problem; a query that perform bad when using a filter almost equal. >> >> ... > > -- > Daniel Cristian Cruz > クルズ クリスチアン ダニエル > -- Daniel Cristian Cruz クルズ クリスチアン ダニエル