| От | Christopher Kings-Lynne |
|---|---|
| Тема | Re: Indexing question |
| Дата | |
| Msg-id | 0be001c36e05$83034fb0$2800a8c0@mars обсуждение исходный текст |
| Ответ на | Indexing question ("Alexander Priem" <ap@cict.nl>) |
| Список | pgsql-performance |
> So if I understand correctly I could ditch the 'deleted' field entirely and > use just the 'deleteddate' field. This 'deleteddate' field would be NULL by > default. It would contain a date value if the record is considered > 'deleted'. > > The index would be 'create index a on tablename(deleteddate) where > deleteddate is null'. > > I could then access 'current' records with a view like 'create view x_view > as select * from tablename where deleteddate is null'. > > Is that correct? This would be the best performing solution for this kind of > thing, I think (theoretically at least)? Yes, I think it would be best. Definitely better than your current solution. Cheers, Chris
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера