From: Stephen Frost <sfrost@snowman.net>
To: Ron <ronljohnsonjr@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: surprising query optimisation
Date: Wed, 5 Dec 2018 10:24:26 -0500
Message-ID: <20181205152426.GE3415@tamriel.snowman.net> (raw)
In-Reply-To: <eab8a947-3e28-8ab6-275d-6646b3e43ace@gmail.com>
References: <03a0af57-3ebc-5501-10ef-6a639c7c34b8@withers.org>
<20181128224950.GS3415@tamriel.snowman.net>
<5d7f8d97-32f3-fd88-44cc-948673579a71@withers.org>
<20181130153327.GA3415@tamriel.snowman.net>
<d2c8a815-7636-7fcf-b1bb-9ade172ddb70@withers.org>
<20181205143853.GC3415@tamriel.snowman.net>
<ab12dfe6-b6c6-95b8-6f4c-b65d12011826@withers.org>
<eab8a947-3e28-8ab6-275d-6646b3e43ace@gmail.com>
Greetings,
* Ron (ronljohnsonjr@gmail.com) wrote:
> On 12/05/2018 08:42 AM, Chris Withers wrote:
> >On 05/12/2018 14:38, Stephen Frost wrote:
> >>>>* Chris Withers (chris@withers.org) wrote:
> >>>Interesting! In my head, for some reason, I'd always assumed a btree index
> >>>would break down a char field based on the characters within it. Does that
> >>>never happen?
> >>
> >>Not sure what you mean by 'break down a char field'.
> >
> >Rather than breaking into three buckets ('NEW', 'ACK', 'RSV'), a more
> >complicated hierarchy ('N', 'NE', 'A', 'AC', etc).
>
> The b-tree indexes on legacy RDBMS which I still occasionally fiddle with
> performs key prefix compression in a manner similar to what you refer to,
> but otherwise that's not how b-trees work.
There's been some discussion of prefix compression in PostgreSQL. Even
with that, though, it hardly seems sensible to have an index which has
tons of duplicates comprising most of the index, and a != would still
have to search the index to make sure there aren't any entries which
need to be returned..
Now, maybe once we get skipping scans where we would be able to skip
over a large chunk of the index because it's just tons of duplicates
without having to visit everything along the way, then maybe having this
inefficient index would "just" take up disk space, but why waste that
space?
Thanks!
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
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-general@postgresql.org
Cc: sfrost@snowman.net, ronljohnsonjr@gmail.com
Subject: Re: surprising query optimisation
In-Reply-To: <20181205152426.GE3415@tamriel.snowman.net>
References: <03a0af57-3ebc-5501-10ef-6a639c7c34b8@withers.org> <20181128224950.GS3415@tamriel.snowman.net> <5d7f8d97-32f3-fd88-44cc-948673579a71@withers.org> <20181130153327.GA3415@tamriel.snowman.net> <d2c8a815-7636-7fcf-b1bb-9ade172ddb70@withers.org> <20181205143853.GC3415@tamriel.snowman.net> <ab12dfe6-b6c6-95b8-6f4c-b65d12011826@withers.org> <eab8a947-3e28-8ab6-275d-6646b3e43ace@gmail.com> <20181205152426.GE3415@tamriel.snowman.net>
* 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