pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Greg Stark <stark@mit.edu>
Cc: Kyotaro HORIGUCHI <horiguchi.kyotaro@oss.ntt.co.jp>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [v9.2] make_greater_string() does not return a string in some cases
Date: Thu, 22 Sep 2011 09:51:12 -0400
Message-ID: <17571.1316699472@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoZsvfs1N0-9-GsiOQxBNyPG5XxAMCVD=wOqd30G6dH9XA@mail.gmail.com>
References: <CA+TgmoYAoGSnk1zMEeq_RWB+D5OjfPX6zmXFetoSZfW70S1p6Q@mail.gmail.com>
	<20110711.155531.15100243.horiguchi.kyotaro@oss.ntt.co.jp>
	<20110712.161231.138791411.horiguchi.kyotaro@oss.ntt.co.jp>
	<20110914.111320.18404009.horiguchi.kyotaro@oss.ntt.co.jp>
	<CA+TgmoYO3UbyCekzDTdVWTG2goEQtr7H_f=9mous9u_uH_StSA@mail.gmail.com>
	<6425.1316656167@sss.pgh.pa.us>
	<CA+TgmoY9+ZUHNju7ERi7QM36FjiXzfT38S63564L_14qf3hgYg@mail.gmail.com>
	<8755.1316665444@sss.pgh.pa.us>
	<CA+Tgmoax-SHNgHe77cJZGsqgsB+Z=n_jzQZ5h0RG1+NcWGHkBg@mail.gmail.com>
	<CAM-w4HMUJox19HkuJJK-vWNJLe0RTQK+P0O6NtfB_mF78zE5Rw@mail.gmail.com>
	<CA+TgmoZsvfs1N0-9-GsiOQxBNyPG5XxAMCVD=wOqd30G6dH9XA@mail.gmail.com>

Robert Haas <robertmhaas@gmail.com> writes:
> On Thu, Sep 22, 2011 at 8:59 AM, Greg Stark <stark@mit.edu> wrote:
>> But the whole problem is that not all the strings with the initial
>> substring are in a contiguous block.

> If that were true for the sorts of indexes we're using for LIKE
> queries, the existing approach wouldn't work either.

Right.  Since it's not a problem for the sorts of indexes with which we
can use LIKE, moving knowledge of LIKE into the btree machinery doesn't
buy us a darn thing, except more complexity in a place where we can ill
afford it.  The essential problem here is "when can you stop scanning,
given a pattern with this prefix?", and btree doesn't know any more
about that than make_greater_string does; it would in fact have to use
make_greater_string or something isomorphic to it.

			regards, tom lane



view thread (57+ messages)  latest in thread

Message-ID: <17571.1316699472@sss.pgh.pa.us>
Permalink:  ../17571.1316699472@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17571.1316699472@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, stark@mit.edu, horiguchi.kyotaro@oss.ntt.co.jp, pgsql-hackers@postgresql.org
  Subject: Re: [v9.2] make_greater_string() does not return a string in some cases
  In-Reply-To: <17571.1316699472@sss.pgh.pa.us>
  References: <CA+TgmoYAoGSnk1zMEeq_RWB+D5OjfPX6zmXFetoSZfW70S1p6Q@mail.gmail.com> <20110711.155531.15100243.horiguchi.kyotaro@oss.ntt.co.jp> <20110712.161231.138791411.horiguchi.kyotaro@oss.ntt.co.jp> <20110914.111320.18404009.horiguchi.kyotaro@oss.ntt.co.jp> <CA+TgmoYO3UbyCekzDTdVWTG2goEQtr7H_f=9mous9u_uH_StSA@mail.gmail.com> <6425.1316656167@sss.pgh.pa.us> <CA+TgmoY9+ZUHNju7ERi7QM36FjiXzfT38S63564L_14qf3hgYg@mail.gmail.com> <8755.1316665444@sss.pgh.pa.us> <CA+Tgmoax-SHNgHe77cJZGsqgsB+Z=n_jzQZ5h0RG1+NcWGHkBg@mail.gmail.com> <CAM-w4HMUJox19HkuJJK-vWNJLe0RTQK+P0O6NtfB_mF78zE5Rw@mail.gmail.com> <CA+TgmoZsvfs1N0-9-GsiOQxBNyPG5XxAMCVD=wOqd30G6dH9XA@mail.gmail.com> <17571.1316699472@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox