From: Tom Lane <tgl@sss.pgh.pa.us>
To: Wells Oliver <wells.oliver@gmail.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: btree/gist index on date and searching using BETWEEN or >= and <=
Date: Mon, 11 Sep 2023 20:08:14 -0400
Message-ID: <2697607.1694477294@sss.pgh.pa.us> (raw)
In-Reply-To: <CAOC+FBUw1fcnNV-4gTx610ZaU-=Znc-ZcTTPe9CzNXhBX4smSw@mail.gmail.com>
References: <CAOC+FBUw1fcnNV-4gTx610ZaU-=Znc-ZcTTPe9CzNXhBX4smSw@mail.gmail.com>
Wells Oliver <wells.oliver@gmail.com> writes:
> Is there a meaningful difference index/plan-wise searching where DATE
> BETWEEN x AND y versus DATE >= x AND DATE <= y?
Nope.
> Secondly, would btree be the best index for such a column, or gist/etc?
btree. gist can sort of do scalar-inequality searches, but they're
not its strength.
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, wells.oliver@gmail.com
Subject: Re: btree/gist index on date and searching using BETWEEN or >= and <=
In-Reply-To: <2697607.1694477294@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