Re: Indexing question
От
Tomasz Myrta
Тема
Re: Indexing question
Дата
Msg-id
3F4EFAB6.7030104@klaster.net
Ответ на
Indexing question (Alexander Priem)
Список
Дерево обсуждения
Re: Indexing question "Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
> Hi all, > > I have some tables (which can get pretty large) in which I want to > record 'current' data as well as 'historical' data. This table has > fields 'deleted' and 'deleteddate' (among other fields, of course). The > field 'deleted' is false be default. Every record that I want to delete > gets the value true for 'deleted' and 'deleteddate' is set to the date > of deletion. > > Since these tables are used a lot by queries that only use 'current' > data, I have created a view with a where clause 'Where not deleted'. > Also, I have indexed field 'deleted'. I think the best choice for your case is using conditional indexes. It should be much better than indexing 'deleted' field. I don't know on which exactly fields you have to create this index - you have to check it by yourself - what do you have in "where" clause? Example: create index some_index on your_table(id_field) where not deleted; Regards, Tomasz Myrta
В списке pgsql-performance по дате отправления