Hi,

Le 1 mai 09 à 23:04, Yeb Havinga a écrit :
An idea for possible improvement of query speed on gist indexes with a costly compression function. We have a gist index that uses a compressed internal datatype. The compression is with some cost (it involves a syscache lookup).

[...]

small one. So it would make sense to add the caching to the gist support in the backend, instead of having to build one in the user defined functions gist functions for every datatype.

Any thoughts?

It seems to me that what you're asking for is addressed indirectly in the possibility to make your internal data type a full SQL visible datatype. Then you store this new datatype directly in the table and index that. Instead of converting from external to internal type at consistent() time in a query, provide an implicit CAST for external to internal for queries to "just work" without editing. The CAST will get called once per literal in the query.

See prefix and the prefix_range datatype as an example of this:
  http://blog.tapoueh.org/prefix.html

I'm not sure if the caching facility should be added to -core PostgreSQL or not, I'm just proposing another way to solve your problem without requiring it...

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

Reply via email to