Index Only Scan support for cube

From: Andrew Borodin <borodin(at)octonica(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Index Only Scan support for cube
Date: 2017-05-23 09:53:56
Message-ID: CAJEAwVEmONZo_h8Gv4JFeYTtuca1BTvxsQosz6HTaWJx_O0Q-w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, hackers!

Here's a small patch that implements fetch function necessary for
Index Only Scans that use cube data type.
I reuse function g_cube_decompress() instead of creating new function
g_cube_fetch().
Essentially, they both have to detoast data.

How do you think, is it better to create a shallow copy of
g_cube_decompress instead?
Any other suggestions on the functionality?

This

CREATE TABLE SOMECUBES AS SELECT CUBE(X,X+1) C FROM GENERATE_SERIES(1,100) X;
CREATE INDEX SOMECUBES_IDX ON SOMECUBES USING GIST(C);
SET ENABLE_SEQSCAN = FALSE;
EXPLAIN (COSTS OFF ) SELECT C FROM SOMECUBES WHERE C<@CUBE(30,40);

now produces

Index Only Scan using somecubes_idx on somecubes
Index Cond: (c <@ '(30),(40)'::cube)

instead of

Index Scan using somecubes_idx on somecubes
Index Cond: (c <@ '(30),(40)'::cube)

Best regards, Andrey Borodin, Octonica.

Attachment Content-Type Size
cubefetch.patch application/octet-stream 3.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2017-05-23 10:26:12 Re: Error-like LOG when connecting with SSL for password authentication
Previous Message tushar 2017-05-23 09:00:41 ALTER SUBSCRIPTION ..SET PUBLICATION <no name> refresh is not throwing error.