Re: Partitioned table scanning all pertitions when the where clause specifies the partition key - Mailing list pgsql-admin

From Paul Smith*
Subject Re: Partitioned table scanning all pertitions when the where clause specifies the partition key
Date
Msg-id 09715bfd-53aa-4504-8400-355d3682158a@pscs.co.uk
Whole thread Raw
In response to Re: Partitioned table scanning all pertitions when the where clause specifies the partition key  (Keith Fiske <keith.fiske@crunchydata.com>)
List pgsql-admin
On 24/10/2024 18:16, Keith Fiske wrote:
>
> Since your index is functional, in order to use the index, the queries 
> must use that same function in the condition. Try doing
>
> EXPLAIN SELECT * FROM customers where lastname = upper('BORRIS');

I thought you'd need to use the same function exactly.


EXPLAIN SELECT * FROM customers where upper(lastname) = upper('BORRIS');


As the index is on 'upper(lastname)', 'upper(lastname)' has to be in the 
query


Paul





pgsql-admin by date:

Previous
From: Keith Fiske
Date:
Subject: Re: Partitioned table scanning all pertitions when the where clause specifies the partition key
Next
From: Sbob
Date:
Subject: Re: Partitioned table scanning all pertitions when the where clause specifies the partition key