SELECT speed with LIKE

Поиск
Список
Период
Сортировка
От JB
Тема SELECT speed with LIKE
Дата
Msg-id 38E64108.36606AE9@kw.igs.net
обсуждение исходный текст
Ответы Re: SELECT speed with LIKE  (brew@theMode.com)
Re: SELECT speed with LIKE  (Frank Bax <fbax@execulink.com>)
Re: SELECT speed with LIKE  ("Robert W. Berger" <rwb@vtiscan.com>)
Список pgsql-general
I've got a real problem with the speed of a select. Some folk might
recall a prev post about a month ago about this 50MB table taking 20+
seconds to complete a query. This table has about 70,000 records in it.
The table has a field called 'stname char(17)' which is indexed. The
query is "SELECT * FROM data WHERE stname LIKE 'MAIN%'". I'm running on
Redhat 6.1, 128MB ram, 40GB, P350. The actual index file is 4 MB.
EXPLAIN tells that it will use the index. The thing still takes about 20
seconds to complete. Can anyone make some suggestions on how I can speed
this up? It seems like such a simple problem I can't see the solution.
Any help would be most appreciated as this abosolutly has to be fixed
and I don't want to have to convert to another DB.

BTW I've run the same thing on a similar machine with 64 MB ram and it
take over a minute to complete. EXPLAIN says...

NOTICE: QUERY PLAN:
Index Scan using nx_data2 on data (cost=3352.28 rows=1 width=440)
EXPLAIN

jim

--
Get hold of portable property.  -- Charles Dickens, "Great Expectations"

В списке pgsql-general по дате отправления:

Предыдущее
От: Thomas Lockhart
Дата:
Сообщение: Re: [INTERFACES] Problem with Large Object Interface ofpgsql_perl5
Следующее
От: "Nilesh A. Phadke"
Дата:
Сообщение: Embedded SQL -- ecpg