Re: How to overload POSITION - Mailing list pgsql-general

From Troels Arvin
Subject Re: How to overload POSITION
Date
Msg-id pan.2004.11.16.21.12.53.350397@arvin.dk
Whole thread Raw
In response to How to overload POSITION  (Troels Arvin <troels@arvin.dk>)
List pgsql-general
On Tue, 16 Nov 2004 15:56:00 -0500, Tom Lane wrote:

> [... cut advice ...]

Thanks.

> How wedded are you to being able to say "IN"?

It's only a would-be-nice-to-have.

My dnaseq data type exploits the fact that DNA sequences are made from a
very small alphabet (four characters), so strings can be compressed/packed
4:1 while still being directly usable. A POSITION(dnaseq IN dnaseq) would
mean that the dnaseq-values don't have to be converted to text before
being searched.

But I can live with my existing DNASEQ_POSITION(dnaseq,dnaseq) solution
(which works directly on the dnaseq packed strings).

(I will also try to create a specialized index for long strings, hopefully
using some substring array algorithmics - but that's another story.)

--
Greetings from Troels Arvin, Copenhagen, Denmark


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: How to overload POSITION
Next
From: Timothy Perrigo
Date:
Subject: Re: question about temp table in function