Re: Bad query plan decision when using multiple column index - postgresql uses only first column then filters - Mailing list pgsql-performance

From Tom Lane
Subject Re: Bad query plan decision when using multiple column index - postgresql uses only first column then filters
Date
Msg-id 2419.1579195659@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bad query plan decision when using multiple column index -postgresql uses only first column then filters  (Michael Lewis <mlewis@entrata.com>)
List pgsql-performance
Michael Lewis <mlewis@entrata.com> writes:
> Does the behavior change with different values of Ver column?

By and large, indxpath.c will just add all qual clauses that match
an index to the indexscan's conditions --- there's no attempt to
decide that some of them might not be worth it on cost grounds.
So I'd be pretty surprised if altering the Ver constant made any
difference.  My money is on there being some reason why the IN
clause doesn't match the index, perhaps a type mismatch.  Without
seeing the table schema, and the exact query, it's hard to say what
that reason is.  (I'll not insult your intelligence by saying how
I know that the OP didn't just copy-and-paste that query.)

            regards, tom lane



pgsql-performance by date:

Previous
From: Cosmin Prund
Date:
Subject: Re: Bad query plan decision when using multiple column index -postgresql uses only first column then filters
Next
From: Cosmin Prund
Date:
Subject: Re: Bad query plan decision when using multiple column index -postgresql uses only first column then filters