Re: Building dynamic contents from database

Поиск
Список
Период
Сортировка
От Frederic Jolliton
Тема Re: Building dynamic contents from database
Дата
Msg-id 863cb31ih4.fsf@mau.localdomain
обсуждение исходный текст
Ответ на Re: Building dynamic contents from database  (Scott Ribe <scott_ribe@killerbytes.com>)
Список pgsql-general
Scott Ribe <scott_ribe@killerbytes.com> writes:

>> name | state  | from_date | to_date
>> ------------------------------------
>> foo  | state2 | <date>    | <date>
>> foo  | state1 | <date>    | <date>
>> bar  | state4 | <date>    | <date>
>> ...
>> foo  | state3 | <date>    | <date>
>
> I would consider using only 1 table, where a NULL to_date indicates the
> current state, and you have a compound index on (name, to_date) to support
> querying for current state. Perhaps you could use a partial index as well to
> speed up those queries, but I haven't yet explored that feature of
> PostgreSQL.

Well.. There is already several indexes (choosed accordingly to
performance test). And, also, table current contains some fields not
found in history, so only 1 table for both type of information is not
ideal.

--
Frédéric Jolliton

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

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: Is my MySQL Gaining ?
Следующее
От: "Keith C. Perry"
Дата:
Сообщение: Re: Is my MySQL Gaining ?