Re: Advice - indexing on varchar fields where only last x characters known
В списке pgsql-sql по дате отправления:
| От | Gavin Flower |
|---|---|
| Тема | Re: Advice - indexing on varchar fields where only last x characters known |
| Дата | |
| Msg-id | 52602FBA.50303@archidevsys.co.nz обсуждение исходный текст |
| Ответ на | Re: Advice - indexing on varchar fields where only last x characters known (Alvaro Herrera <alvherre@2ndquadrant.com>) |
| Список | pgsql-sql |
On 18/10/13 07:39, Alvaro Herrera wrote: > Gary Stainburn wrote: > >> The problem that I have is that these VIN numbers are provided by a number of >> data systems including manufacturer feeds, logistics companies as well as >> internal systems. Some use the full 17 character string while others only use >> the last 11. >> >> On top of this, my users are used to only having to type the last 6 characters >> for speed and usability reasons. > Try creating an index on reverse(vin) and using the same function in > queries; you can put a % at the end of the sought-for literal to match > suffixes. That works quite well and is very simple to implement. > That is extremely cunning, and obvious in retrospect! :-) Cheers, Gavin
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера