Re: temporary tables, indexes, and query plans

Поиск
Список
Период
Сортировка
От Jon Nelson
Тема Re: temporary tables, indexes, and query plans
Дата
Msg-id AANLkTikJp-geSNQyDwEWDvZfjM0195J7PJN5yuRxuJBt@mail.gmail.com
обсуждение исходный текст
Ответ на Re: temporary tables, indexes, and query plans  ("Reid Thompson" <Reid.Thompson@ateb.com>)
Ответы Re: temporary tables, indexes, and query plans
Re: temporary tables, indexes, and query plans
Re: temporary tables, indexes, and query plans
Список pgsql-performance
On Wed, Oct 27, 2010 at 1:32 PM, Reid Thompson <Reid.Thompson@ateb.com> wrote:
> On Wed, 2010-10-27 at 13:23 -0500, Jon Nelson wrote:
>> set it to 500 and restarted postgres.
>
> did you re-analyze?

Not recently. I tried that, initially, and there was no improvement.
I'll try it again now that I've set the stats to 500.
The most recent experiment shows me that, unless I create whatever
indexes I would like to see used *before* the large (first) update,
then they just don't get used. At all. Why would I need to ANALYZE the
table immediately following index creation? Isn't that part of the
index creation process?

Currently executing is a test where I place an "ANALYZE foo" after the
COPY, first UPDATE, and first index, but before the other (much
smaller) updates.

..

Nope. The ANALYZE made no difference. This is what I just ran:

BEGIN;
CREATE TEMPORARY TABLE foo
COPY ...
UPDATE ... -- 1/3 of table, approx
CREATE INDEX foo_rowB_idx on foo (rowB);
ANALYZE ...
-- queries from here to 'killed' use WHERE rowB = 'someval'
UPDATE ... -- 7 rows. seq scan!
UPDATE ... -- 242 rows, seq scan!
UPDATE .. -- 3700 rows, seq scan!
UPDATE .. -- 3100 rows, seq scan!
killed.


--
Jon

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

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: Massive update, memory usage
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: CPUs for new databases