| От | Tom Lane |
|---|---|
| Тема | Re: Further thoughts on Referential Integrity |
| Дата | |
| Msg-id | 22669.1021907578@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Further thoughts on Referential Integrity ("Joel Burton" <joel@joelburton.com>) |
| Список | pgsql-general |
"Joel Burton" <joel@joelburton.com> writes:
> So, I'd say you _still_ have three options:
> * use NULLs (which will be slower by a bit when the index is being used),
> * use an orphanage (which will be slower by a __tiny__ bit for all selects,
> because you'll be adding one more exclusion to your WHERE clause)
> * or re-write RI (which will be much slower for INSERTs, DELETEs, UPDATEs,
> and might be a bit more of a pain to port to other systems or maintain).
There's also option 4:
* use NULLs, and make a partial index using "WHERE foo IS NULL" to
catalog the rows containing nulls.
The cost of maintaining the extra index wouldn't be worth it unless
looking for the null rows is done very frequently ... but it is another
option to consider.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера