X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id E4CC59FB0D1 for ; Fri, 7 Jul 2006 14:42:20 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 13321-06 for ; Fri, 7 Jul 2006 14:42:17 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.195]) by postgresql.org (Postfix) with ESMTP id D15079FA603 for ; Fri, 7 Jul 2006 14:42:17 -0300 (ADT) Received: by nz-out-0102.google.com with SMTP id z3so1085542nzf for ; Fri, 07 Jul 2006 10:42:16 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=VdSqv/cpyahapbchE5jtg91RKhaq59U2GSn4NXKrX3OTxKdTBH22WgEDjxrlEb16T21wC5Ehv/HC1022wpj6LEqMDwiNa809gCJQ7b1dHbJSyImNOB+PdneNgYZ5MBvsqNCwn/xxKm8FsXKzhN1ujDUX4ecnlZBAlc05K7wcJKo= Received: by 10.65.249.3 with SMTP id b3mr2526612qbs; Fri, 07 Jul 2006 10:42:16 -0700 (PDT) Received: by 10.65.139.14 with HTTP; Fri, 7 Jul 2006 10:42:16 -0700 (PDT) Message-ID: Date: Fri, 7 Jul 2006 13:42:16 -0400 From: "Merlin Moncure" To: Luckys Subject: Re: how to tune this query. Cc: pgsql-performance@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/68 X-Sequence-Number: 19928 On 7/4/06, Luckys wrote: > > Hi all, > I got this query, I'm having indexes for PropertyId and Dates columns across > all the tables, but still it takes ages to get me the result. What indexes > would be proposed on this, or I'm helpless? > I would suggest posting your table schemas and describe what you want the results to look like. After years of following this list, I regard your query as something of a classic. There simply has to be an easier way of writing it. merlin