| От | Tom Lane |
|---|---|
| Тема | Re: < operator for user-defined types |
| Дата | |
| Msg-id | 11453.1080228568@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | < operator for user-defined types (Teodor Sigaev <teodor@sigaev.ru>) |
| Список | pgsql-hackers |
Teodor Sigaev <teodor@sigaev.ru> writes:
> So, I must declare b-tree opclass for tsvector. Why?
> My supposition is to guarantee that operator < is really 'less-than'
> one. Is it?
Exactly. We used to assume that any operator named '<' would be
suitable for sorting, but it's a lot safer to assume that an operator
associated with a b-tree opclass behaves in the right way. Also there
are some optimizations possible as a result. (It turns out that the
sorting code will end up using the comparison support function for the
opclass, and not the operator per se, because that way we only need one
function call per comparison. Using the operator, we'd often need two
calls.)
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера