Gist consistent and compression

From: Yeb Havinga <y(dot)t(dot)havinga(at)mgrid(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Gist consistent and compression
Date: 2009-05-01 21:04:22
Message-ID: 49FB63D6.9040300@mgrid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello list,

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). The functions called by the consistent functions are
binary functions on the internal type. Since the query parameter passed
to consistent is the 'external' datatype, it must be compressed by the
consistent function. When performing a query, the same data value (the
query) is compressed repeatedly while traversing the nodes in the index
tree. The query speed increased substantially after building in an ad
hoc caching (a hash) in the compression function.

We believe that every gist index that uses compression could benefit
from a cache, even a 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?

regards,
Yeb Havinga

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2009-05-01 21:18:25 Re: Throw some low-level C scutwork at me
Previous Message Dimitri Fontaine 2009-05-01 21:02:40 Re: Throw some low-level C scutwork at me