Would a unique index, or a trigger doing a:
IF ( SELECT COUNT(*) where _index_condition_ ) THEN
CRY MOMMA and GO HOME.
The right hand little finger on the carriager return is quicker than my brain. I
will now FINISH my question :-)
----------------------------------------------------
Would a unique index, or a trigger doing a:
IF ( SELECT COUNT(*) where _index_condition_ ) THEN
CRY MOMMA and GO HOME.
be faster?
On Wednesday 26 Mar 2003 10:57 pm, Dennis Gearon wrote: > The right hand little finger on the carriager return is quicker than my > brain. I will now FINISH my question :-) > > ---------------------------------------------------- > Would a unique index, or a trigger doing a: > > IF ( SELECT COUNT(*) where _index_condition_ ) THEN > CRY MOMMA and GO HOME. > > be faster? SELECT COUNT(*) will always do a sequential scan (at the moment and for the immediate future versions AFAIK). Unless the table is small, a unique index seems the best. -- Richard Huxton
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера