Re: Multiple indexes, huge table

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема Re: Multiple indexes, huge table
Дата
Msg-id CAMkU=1wTB0HBFcbO40ANuYBV7amVp4iBqn8v1=XT4F8UNwbsnQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Multiple indexes, huge table  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Multiple indexes, huge table
Re: Multiple indexes, huge table
Список pgsql-general
>
>> There are also rare cases where I might want to make a correction.  For example, one of the columns is sample name
whichis a foreign key to a samples table defined with " ON UPDATE CASCADE."  I decided to change a sample name in the
samplestable which should affect about 20 million rows out of the previously mentioned 500 million.  That query has now
beenrunning for five days and isn't finished yet. 
>
> That sounds like you lack an index on the referencing column of the
> foreign key constraint.  Postgres doesn't require you to keep such
> an index, but it's a really good idea if you ever update the referenced
> column.

For updating 20 million out of 500 million rows, wouldn't a full table
scan generally be preferable to an index scan anyway?

But, if he doesn't drop those other indexes during this process, the
maintenance on them is going to kill his performance anyway, just like
it does for bulk loading.  If you figure 20,000,000 * (1 table + 5
index) / 15,000 rpm, it comes out to around 5 days.

Cheers,

Jeff


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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: PostgreSQL server embedded in NAS firmware?
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: PostgreSQL server embedded in NAS firmware?