Re: Are indexes blown?

From: Richard Huxton <dev(at)archonet(dot)com>
To: Phoenix Kiula <phoenix(dot)kiula(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Are indexes blown?
Date: 2008-02-15 11:20:10
Message-ID: 47B5756A.50105@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Phoenix Kiula wrote:
> Hi,
>
> I have an index on the user_id field in the query below:
>
> myuser=# delete from clients where user_id like '64.22.91.%';
> DELETE 22
> Time: 220324.975 ms
>
> Is there any reason why it's taking 220 seconds to run this simple
> query? There are about 3 million rows in this table.

First guess is that it's not using the index. What does
EXPLAIN ANALYSE SELECT user_id FROM clients WHERE user_id LIKE '...'
show?

Check the list archives for locale and like and text_pattern_ops too -
that's a good place to check.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Phoenix Kiula 2008-02-15 12:18:30 Re: Are indexes blown?
Previous Message Shoaib Mir 2008-02-15 11:05:13 Re: Are indexes blown?