Re: Planner matching constants across tables in a - Mailing list pgsql-performance

From Josh Berkus
Subject Re: Planner matching constants across tables in a
Date
Msg-id web-2881474@davinci.ethosmedia.com
Whole thread Raw
In response to Re: Planner matching constants across tables in a join  (Richard Huxton <dev@archonet.com>)
Responses Re: Planner matching constants across tables in a
Re: Planner matching constants across tables in a
List pgsql-performance
Richard,

> A domain defined as varchar() actually - which is why it's not using
> an index,
> but that's neither here nor there regarding the constant issue.

You might improve your performance overall if you cast the constant to
tel_num before doing the comparison in the query.   Right now, the
parser is casting the whole column to text instead, because it can't
tell that the constant you supply is a valid tel_num.

-Josh

pgsql-performance by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Planner matching constants across tables in a join
Next
From: Richard Huxton
Date:
Subject: Re: Planner matching constants across tables in a