search on tables

From: "Sidar Lopez Cruz" <sidarlopez(at)hotmail(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: search on tables
Date: 2003-03-26 22:26:35
Message-ID: OE61JABSCu6U5QH6PyL0000473f@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

why searching with like or ilike on tables with too many records is too slow?
i have a table like this

create table sujetos (cedula varchar(20) not null primary key, nombre varchar(255), id_tipo_documento bigint);
create index idx_nombre on sujetos (nombre);

and them, i insert 5,000,000 of records from mssql

then, i do something like that, select * from sujetos where nombre like 'LOPEZ CRUZ SIDAR%', and the request from the server is normal, but when i do this, select * from sujetos where nombre like 'lopez%sidar%';

the server die.... searching this string....

:-) Sidar Lopez Cruz
- Cero Riesgo, S.A.

Browse pgsql-admin by date

  From Date Subject
Next Message Nikolaus Dilger 2003-03-27 02:14:55 Re: search on tables
Previous Message Robert Treat 2003-03-26 22:17:58 Re: pg_dump version conflict