Re: temporal support patch

Поиск
Список
Период
Сортировка
От Miroslav Šimulčík
Тема Re: temporal support patch
Дата
Msg-id CAHRNM6_WFQ_XA+MQD4HHigYOFy0qPBE8-2kdS=xEUeeNLir7MQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: temporal support patch  (Jim Nasby <jim@nasby.net>)
Список pgsql-hackers
2012/5/30 Jim Nasby <jim@nasby.net>
On 5/18/12 2:06 AM, Miroslav Šimulčík wrote:
- no data redundancy - in my extension current versions of entries are stored only once in original table (in table_log - entries are inserted to both original and log table)

That's not necessarily a benefit... it makes querying for both history *and* current data a lot more complex. Table inheritance might be an elegant solution to that, but I doubt you could just bolt that on top of what you've created.


Yes, querying for history data is more complex, but i focused on preserving the performance of current queries. That's the reason why I use separate table for old versions.

Table inheritance is very good idea and it will not require so much effort to use it in my solution. Currently, when user queries whole history of entries, table reference in FROM clause is replaced with subselect, which access data in both tables. For example when user executes command:

NONSEQUENCED TRANSACTIONTIME SELECT * FROM person;

The actually executed command is:

SELECT * FROM (SELECT * FROM person UNION ALL SELECT * FROM person_hist) as person

Use of table inheritance can make things simpler and more elegant, but I'm not sure about how it affect performance. Will it cause gain in performance?


The timestamp fields need to have timezone info. If you change the timezone for a connection you will get inconsistent results without it.

_sys_end should either be NULLable or if it's going to have a magic value that magic value should be "Infinity":

 
Good point. I will use timestamp with timezone and  value "Infinity" instead of max timestamp value

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

Предыдущее
От: Gabriele Bartolini
Дата:
Сообщение: Re: [PATCH] Support for foreign keys with arrays
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Is cachedFetchXidStatus provably valid?