På lørdag 20. januar 2024 kl. 06:35:07, skrev Tom Lane mailto:t...@sss.pgh.pa.us>>:
[…]
Well, we can definitively state that the NOT makes this unindexable.
You need a WHERE clause that looks like
indexed-column indexable-operator pseudo-constant
which this isn't, nor does << have a negator opera
Adrian Klaver writes:
> On 1/19/24 20:08, Andreas Joseph Krogh wrote:
>> This seems to do what I want:
>> |NOT (drange << daterange(CURRENT_DATE, NULL, '[)'))|
>> But this doesn't use the index.
>> Any idea how to write a query so it uses the index on |drange|?
> Without the full query and the EX
create table order_line ( id serial primary key, start_date DATE NOT NULL,
end_date DATE, drange daterange NOT NULL GENERATED ALWAYS AS
(daterange(start_date, end_date, '[)')) STORED ); CREATE INDEX
order_line_not_end_idx ON order_line using gist(drange); INSERT INTO
order_line(start_date, end
On 1/19/24 20:08, Andreas Joseph Krogh wrote:
I have order-lines with start-end like this:
|start_date DATE NOT NULL, end_date DATE, drange daterange NOT NULL
GENERATED ALWAYS AS (daterange(start_date, end_date, '[)')) STORED|
and have an index on |using gist(drange)|
I want to list all orde
I have order-lines with start-end like this:
start_date DATE NOT NULL, end_date DATE, drange daterange NOT NULL GENERATED
ALWAYS AS (daterange(start_date, end_date, '[)')) STORED
and have an index on using gist(drange)
I want to list all order-lines which does not have end-date set in the pas
On Fri, Jan 19, 2024 at 11:37 AM Tom Lane wrote:
> Ron Johnson writes:
> > On an RDMS which I used in the 1990s and 2000s, b-tree indices of
> sequences
> > would get unbalanced, since every new leaf was added to the far right
> > corner of the tree.
> > Sure, they would auto-balance *to a degre
Ron Johnson writes:
> On an RDMS which I used in the 1990s and 2000s, b-tree indices of sequences
> would get unbalanced, since every new leaf was added to the far right
> corner of the tree.
> Sure, they would auto-balance *to a degree* during node splits, but all
> those "far-right corner" inser
On an RDMS which I used in the 1990s and 2000s, b-tree indices of sequences
would get unbalanced, since every new leaf was added to the far right
corner of the tree.
Sure, they would auto-balance *to a degree* during node splits, but all
those "far-right corner" inserts still left them pretty lopsi
Thank you very much for your quick answer and patch!
I tested and this is exactly what I was looking for :-)
Best
Chantal
Le 18/01/2024 à 18:55, Tom Lane a écrit :
Chantal Keller writes:
I would like "explain" to output formulas for filtering over
subplans. Is it possible?
No, and that'