Re: optimize query?

Поиск
Список
Период
Сортировка
От hamann.w@t-online.de
Тема Re: optimize query?
Дата
Msg-id 510920F5.mailx43Y11TD0Y@amadeus3.local
обсуждение исходный текст
Ответ на optimize query?  (hamann.w@t-online.de)
Список pgsql-general
Bob Futrelle wrote:

If looking for the variants with a single suffixed character is all you'll
ever need to do:
Do a single pass on the large table, after creating a field, 'trunc' that
contains a truncated version of the item, e.g., adding XY423 to trunc for
each entry of the form XY423A, or XY423B, etc.  This would be a one-time
operation.

Hi Bob,

unfortunately it is not because  the suffix pattern is not always the same.
On the other hand, I tried to split the query into

select substring (code from '^[A-Z]+[0-9]+') as code into tmp table t
select .... where tab2.code = t.code

which definitely was a big improvement. I believe that most of the time
passing in a pattern like that would work

So thank you for that tip

Regards
Wolfgang


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

Предыдущее
От: c k
Дата:
Сообщение: Re: finding if a period is multiples of a given interval
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: trouble with upgrade from 9.0 (many schemas and tables)