[HACKERS] Index Only Scan support for cube - Mailing list pgsql-hackers

From Andrew Borodin
Subject [HACKERS] Index Only Scan support for cube
Date
Msg-id CAJEAwVEmONZo_h8Gv4JFeYTtuca1BTvxsQosz6HTaWJx_O0Q-w@mail.gmail.com
Whole thread Raw
Responses Re: [HACKERS] Index Only Scan support for cube  (Andrey Borodin <x4mmm@yandex-team.ru>)
List 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.

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: tushar
Date:
Subject: [HACKERS] ALTER SUBSCRIPTION ..SET PUBLICATION refresh is notthrowing error.
Next
From: Heikki Linnakangas
Date:
Subject: Re: [HACKERS] Error-like LOG when connecting with SSL for passwordauthentication