Re: Database slowness -- my design, hardware, or both?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Database slowness -- my design, hardware, or both?
Дата
Msg-id 20070306201939.GH12837@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Database slowness -- my design, hardware, or both?  ("Reuven M. Lerner" <reuven@lerner.co.il>)
Ответы Re: Database slowness -- my design, hardware, or both?  ("Reuven M. Lerner" <reuven@lerner.co.il>)
Список pgsql-general
Reuven M. Lerner escribió:
> Hi, Webb Sprague.  You wrote:
> >... but I see two seq scans in your explain in a loop -- this is
> >probably not good.  If you can find a way to rewrite the IN clause
> >(either de-normalizing through triggers to save whatever you need on
> >an insert and not have to deal with a set, or by using except in the
> >query, or someing else more creative)...
> I would normally agree that an IN clause is a place to worry -- except
> that I'm using IN on a very small table, with about 4-5 rows.  That
> might indeed affect things, and I could certainly pull out these values
> into a Perl variable that I then interpolate literally into the SQL.
> However, I have to assume that this wouldn't affect things all that much.

Don't assume -- measure.  I had a query which ran orders of magnitude
faster because I interpolated the constant list in the big query.  The
table from which the interpolated values were being extracted had about
30 rows or so.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

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

Предыдущее
От: Alexander Elgert
Дата:
Сообщение: postgres slower on nested queries
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: postgres slower on nested queries