Re: discarding duplicate indexes

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: discarding duplicate indexes
Дата
Msg-id 50D2D17E.1030303@hogranch.com
обсуждение исходный текст
Ответ на Re: discarding duplicate indexes  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
Список pgsql-hackers
On 12/20/2012 12:26 AM, Gavin Flower wrote:
CREATE TABLE test (id int, int sub, text payload);
CREATE INDEX test_idx1 ON test (id, sub);
CREATE INDEX test_idx2 ON test (id);


Now test_idx2 is logically included in test_idx1, but if the majority of transactions only query on id, then test_idx2 would be more better as it ties up less RAM

if sub is an integer, that index isn't that much larger.  both indexes need to index all the rows, and with the header and block overhead, the extra word isn't that big of a deal.   as long as there are some transactions using the other index, most of both of them will likely want to be in memory, so you'll end up using MORE memory.


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