Re: PHP performance problems with postgres - Mailing list pgsql-general

From Colin 't Hart
Subject Re: PHP performance problems with postgres
Date
Msg-id 9n7hg0$2j2c$1@news.tht.net
Whole thread Raw
List pgsql-general
Jon asks:

> Can anyone shed any light on why using like instead of = on one column
> should cause such a significant slow down (45secs / 0.4 secs)?

A query involving a LIKE operator can only use an index if the wildcard(s)
are placed after an initial constant string. The initial constant string
is what is looked up in the index; wildcard matching is done with either
a scan of the relevant part of the index or with a full table scan.

Cheers,

Colin



pgsql-general by date:

Previous
From: "J.H.M. Dassen (Ray)"
Date:
Subject: Re: problem with selects based on dates
Next
From: Peter Eisentraut
Date:
Subject: Re: Bug in createlang?