Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VX8Nd-0002TE-F6 for pgsql-sql@arkaria.postgresql.org; Fri, 18 Oct 2013 11:38:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VX8Nc-00012j-SH for pgsql-sql@arkaria.postgresql.org; Fri, 18 Oct 2013 11:38:08 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VX8Nc-00012d-4M for pgsql-sql@postgresql.org; Fri, 18 Oct 2013 11:38:08 +0000 Received: from teak.britvault.co.uk ([78.33.153.148]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VX8NV-000773-FX for pgsql-sql@postgresql.org; Fri, 18 Oct 2013 11:38:07 +0000 Received: by teak.britvault.co.uk (Postfix, from userid 1970) id 3d1QGZ6zk7zB9X; Fri, 18 Oct 2013 12:37:58 +0100 (BST) Date: Fri, 18 Oct 2013 12:37:58 +0100 To: pgsql-sql@postgresql.org Subject: Re: Re: Advice - indexing on varchar fields where only last x characters known Message-ID: <20131018113758.GA958@teak.britvault.co.uk> References: <201310171220.44550.gary.stainburn@ringways.co.uk> <1382037390671-5774944.post@n5.nabble.com> <201310180822.48251.gary.stainburn@ringways.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201310180822.48251.gary.stainburn@ringways.co.uk> User-Agent: Mutt/1.5.21 (2010-09-15) From: skinner@britvault.co.uk (Craig R. Skinner) X-Pg-Spam-Score: 0.3 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org On 2013-10-18 Fri 08:22 AM |, Gary Stainburn wrote: > > While the reverse() option may work for searching it will not be ideal for > foreign keys. > Use an integer (serial) as the PK/FK & unique the VIN. Then you can use reverse() for searching. Kitcars, boat/garden/equipment/truck trailers, caravans, etc. might not have any VIN. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql