Re: Advice - indexing on varchar fields where only last x characters known

From: skinner(at)britvault(dot)co(dot)uk (Craig R(dot) Skinner)
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Advice - indexing on varchar fields where only last x characters known
Date: 2013-10-17 11:45:12
Message-ID: 20131017114512.GA24563@teak.britvault.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 2013-10-17 Thu 12:20 PM |, 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.
>

Split the vin into 2/3 columns?
vin_prefix (NULL), vin_suffix (NOT NULL)
vin_prefix, vin_centre, vin_suffix

UNIQUE all together in 1 constraint & index each separately.

Maybe...
--
Craig Skinner | http://twitter.com/Craig_Skinner | http://linkd.in/yGqkv7

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Gavin Flower 2013-10-17 18:27:05 Re: Advice - indexing on varchar fields where only last x characters known
Previous Message Jayadevan M 2013-10-17 11:35:31 Re: Advice - indexing on varchar fields where only last x characters known