Re: improving speed of query that uses a multi-column "filter" ? - Mailing list pgsql-general

From Jonathan Vanasco
Subject Re: improving speed of query that uses a multi-column "filter" ?
Date
Msg-id 657A6E9C-53C7-4A79-A22C-D13CE3954FB9@2xlp.com
Whole thread Raw
In response to Re: improving speed of query that uses a multi-column "filter" ?  (Misa Simic <misa.simic@gmail.com>)
List pgsql-general

On Oct 1, 2014, at 12:34 AM, Misa Simic wrote:

Have you considered maybe partial indexes?


I.e idx1 on pk column of the table with where inside index exactly the same as your first where

Idx2 on pk column with where inside index as second where

That was actually my first attempt , and I was hoping it would work.  

Unfortunately, there is always something in the queries that keeps Postgres trying to use other (slower) indexes or jumping to a sequential scan.  

I haven't been able to trick the planner into using the partial index, and most online resources suggested it wasn't possible.

pgsql-general by date:

Previous
From: David G Johnston
Date:
Subject: Re: Extract especific text from a sql statement
Next
From: François Beausoleil
Date:
Subject: Is there a way to get both the plan and the results?