Re: PostgreSQL index issue

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: PostgreSQL index issue
Дата
Msg-id D960CB61B694CF459DCFB4B0128514C2082466D4@exadv11.host.magwien.gv.at
обсуждение исходный текст
Ответ на PostgreSQL index issue  (mperformer <codevally.mail.list@gmail.com>)
Ответы Re: PostgreSQL index issue  (codevally <codevally.mail.list@gmail.com>)
Список pgsql-general
mperformer wrote:
> I have a question regarding PostgreSQL 9.1 indexing.
>
> I am having a table and want to create a index for a column and I want
to store the data with time
> zone for that column. The questions are:
>
> 1. Can I create a index for a column which store time stamp with time
zone. If can is there ant
> performance issues?

Yes, you can create an index on a TIMESTAMP WITH TIME ZONE column.
There are no performance problems except the ones that always
come with an index: INSERTs, UPDATEs and DELETEs will be slower
and do more disk I/O and locking.

> 2. Also I can store the time stamp value with zone as a long integer
value. If so what is the
> difference between the above step. Which one is better.

The smaller the indexed column is, the smaller and faster the
index will be. A timestamp uses 8 bytes, same as a bigint, so
that shouldn't matter.

Use the representation that is most useful to your processing.
For timestamps, this is usually the timestamp data type (which
automatically rejects impossible dates and provides date
arithmetic).

Yours,
Laurenz Albe

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

Предыдущее
От: Bartosz Dmytrak
Дата:
Сообщение: Re: PostgreSQL limitations question
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: PostgreSQL limitations question