Re: Index usage with slow query - Mailing list pgsql-general

From David G Johnston
Subject Re: Index usage with slow query
Date
Msg-id 1406312083372-5812862.post@n5.nabble.com
Whole thread Raw
In response to Re: Index usage with slow query  (Bill Moran <wmoran@potentialtech.com>)
Responses Re: Index usage with slow query  (Marc Mamin <M.Mamin@intershop.de>)
List pgsql-general
Bill Moran wrote
> On Fri, 25 Jul 2014 17:20:57 +0100
> Rebecca Clarke <

> r.clarke83@

> > 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.


pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: event triggers in 9.3.4
Next
From: Alvaro Herrera
Date:
Subject: Re: event triggers in 9.3.4