Re: best way to fetch next/prev record based on index

From: Greg Stark <gsstark(at)mit(dot)edu>
To: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
Cc: <gsstark(at)mit(dot)edu>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: best way to fetch next/prev record based on index
Date: 2004-07-29 18:49:34
Message-ID: 87vfg6ps1t.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


"Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com> writes:

> However, this would work:
> Create index on t(stackparam(array[a::text,b::text,c::text),
> array['char(2)', 'int', 'date')];

Well, I fear not all datatypes sort properly when treated as text. Notably
integers don't. "10" sorts before "2" for example. You could probably deal
with this with careful attention to each datatype you're converting if you're
interested in going to that length.

--
greg

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Merlin Moncure 2004-07-29 20:11:49 Re: best way to fetch next/prev record based on index
Previous Message Tom Lane 2004-07-29 18:41:37 Re: best way to fetch next/prev record based on index