Re: Index usage with slow query

From: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Index usage with slow query
Date: 2014-07-25 18:14:43
Message-ID: 1406312083372-5812862.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bill Moran wrote
> On Fri, 25 Jul 2014 17:20:57 +0100
> Rebecca Clarke &lt;

> r.clarke83@

> &gt; wrote:
>
> Note that this is speculation on my part, but the
> point being that if those columns are usually as narrow as your
> examples you might want to try changing them to VARCHAR(50) or
> something and see if the planner is more willing to use the
> indexes at that point.
>
> A lot of this is pure speculation on my part ... hope that it's
> helpful and doesn't lead you in the wrong direction.

The presence of absence of the length limiter on a varchar will not impact
the query plan. And I'm pretty sure you cannot even store a too long
varchar in an index. It will error on the attempt (as opposed to
truncating).

David J.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Index-usage-with-slow-query-tp5812503p5812862.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2014-07-25 18:46:34 Re: event triggers in 9.3.4
Previous Message Pavel Stehule 2014-07-25 18:07:03 Re: event triggers in 9.3.4