Re: Insert performance with composite index

Поиск
Список
Период
Сортировка
От Cédric Villemain
Тема Re: Insert performance with composite index
Дата
Msg-id AANLkTik7zy95Rbj-oLTHF5ATvKN_QeoG_-wu=BYyCydu@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Insert performance with composite index  (hubert depesz lubaczewski <depesz@depesz.com>)
Список pgsql-performance
2010/11/2 hubert depesz lubaczewski <depesz@depesz.com>:
> On Tue, Nov 02, 2010 at 12:04:42PM +0100, Cédric Villemain wrote:
>> 2010/11/2 hubert depesz lubaczewski <depesz@depesz.com>:
>> > On Mon, Nov 01, 2010 at 02:57:56PM +0100, Cédric Villemain wrote:
>> >> >   CONSTRAINT tableindex_pkey PRIMARY KEY (tableindex)
>> >> > )
>> >> > the index definition is
>> >> > CREATE INDEX "PK_AT2"
>> >> >   ON ABC
>> >> >   USING btree
>> >> >   (event, tableindex)
>> >> > TABLESPACE sample;
>> >>
>> >> Indexing twice the same column is useless. (perhaps move your PK to
>> >> the tablespace 'sample' is good too ?)
>> >
>> > why do you say that?
>> > these are not the same indexes and they serve different purposes.
>>
>> Given that tableindex is the PK column, I really like to now the usage
>> pattern for having it indexed twice.
>
> select * from table where event = 123 order by tableindex desc limit 50;

Correct. Thanks Hubert.

--
Cédric Villemain               2ndQuadrant
http://2ndQuadrant.fr/     PostgreSQL : Expertise, Formation et Support

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

Предыдущее
От: Divakar Singh
Дата:
Сообщение: Re: Insert performance with composite index
Следующее
От: Mladen Gogala
Дата:
Сообщение: Test