Re: PHP performance problems with postgres

From: "Colin 't Hart" <cthart(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: PHP performance problems with postgres
Date: 2001-09-06 10:01:10
Message-ID: 9n7hg0$2j2c$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Colin 't Hart 2001-09-06 10:05:23 Re: MySQL's (false?) claims... (was: Re: PL/java?)
Previous Message J.H.M. Dassen (Ray) 2001-09-06 09:00:10 Re: problem with selects based on dates