Gist consistent and compression - Mailing list pgsql-hackers

From Yeb Havinga
Subject Gist consistent and compression
Date
Msg-id 49FB63D6.9040300@mgrid.net
Whole thread Raw
Responses Re: Gist consistent and compression  (Dimitri Fontaine <dfontaine@hi-media.com>)
List 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



pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Throw some low-level C scutwork at me
Next
From: Jaime Casanova
Date:
Subject: Re: Table data exclusion patch for pg_dump