pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Emre Hasegeli <emre@hasegeli.com>
Cc: Teodor Sigaev <teodor@sigaev.ru>
Cc: PostgreSQL Bugs <pgsql-bugs@postgresql.org>
Subject: Re: Wrong Results from SP-GiST with Collations
Date: Mon, 16 Apr 2018 15:55:52 -0400
Message-ID: <26053.1523908552@sss.pgh.pa.us> (raw)
In-Reply-To: <CAH2-WznG1-gnBcHuSDNd=u+1oYiJHkN75P-m9cNkN7aP9j4v5Q@mail.gmail.com>
References: <CAE2gYzzb6K51VnTq5i5p52z+j9p2duEa-K1T3RrC_GQEynAKEg@mail.gmail.com>
	<CAH2-Wz=fBmXr5M=b8oQgD_k+V8jXAXOq1Zho_jz9kmUkPF86dw@mail.gmail.com>
	<CAE2gYzx_kC06hQkvF6VsFgt_47+vPfevsWee5gqy95LJE59PvQ@mail.gmail.com>
	<CAH2-Wzn-WOUtAQbnFrhbHWO69vq0QOkwkcwNykQ=qjJfkOM5Jg@mail.gmail.com>
	<19693.1523904666@sss.pgh.pa.us>
	<CAH2-WzkUksjq9M=OFvY4nd4ywA4BGAyBBBpFSEjLyhjWq8YYMw@mail.gmail.com>
	<20362.1523906934@sss.pgh.pa.us>
	<CAH2-WznG1-gnBcHuSDNd=u+1oYiJHkN75P-m9cNkN7aP9j4v5Q@mail.gmail.com>

Peter Geoghegan <pg@bowt.ie> writes:
> On Mon, Apr 16, 2018 at 12:28 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> True.  This way saves a few cycles, but maybe it's not worth the extra
>> code.  I think the only case where you could really notice the difference
>> is for an equality search operator, which might end up doing a lot more
>> work in non-C collations (full-blown strcoll vs memcmp).

> I don't have a full understanding of this particular problem, but it
> sounds to me that that would be a non-issue due to the equality
> fast-path added to varstr_cmp() several years ago. I microbenchmarked
> it quite extensively at the time, and concluded that it was all but
> free in cases where it didn't work out.

I'm not following --- varstr_cmp has no way to know that we only
care about equality vs inequality.  Yes, it might give back an
answer quickly when the strings are equal, but when they aren't,
it has to decide which is greater.  In this case we don't care,
so long as the search operator is "=".

			regards, tom lane




view thread (11+ messages)  latest in thread

Message-ID: <26053.1523908552@sss.pgh.pa.us>
Permalink:  ../26053.1523908552@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26053.1523908552@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, pg@bowt.ie, emre@hasegeli.com, teodor@sigaev.ru
  Subject: Re: Wrong Results from SP-GiST with Collations
  In-Reply-To: <26053.1523908552@sss.pgh.pa.us>
  References: <CAE2gYzzb6K51VnTq5i5p52z+j9p2duEa-K1T3RrC_GQEynAKEg@mail.gmail.com> <CAH2-Wz=fBmXr5M=b8oQgD_k+V8jXAXOq1Zho_jz9kmUkPF86dw@mail.gmail.com> <CAE2gYzx_kC06hQkvF6VsFgt_47+vPfevsWee5gqy95LJE59PvQ@mail.gmail.com> <CAH2-Wzn-WOUtAQbnFrhbHWO69vq0QOkwkcwNykQ=qjJfkOM5Jg@mail.gmail.com> <19693.1523904666@sss.pgh.pa.us> <CAH2-WzkUksjq9M=OFvY4nd4ywA4BGAyBBBpFSEjLyhjWq8YYMw@mail.gmail.com> <20362.1523906934@sss.pgh.pa.us> <CAH2-WznG1-gnBcHuSDNd=u+1oYiJHkN75P-m9cNkN7aP9j4v5Q@mail.gmail.com> <26053.1523908552@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