In theory, any indexed value in index (for GiST, after compression) should fit into page at least.
So are you saying we should dedicate one page multiplied by
max_connections in shared memory? It's possible to do it that way, but

Yes, we could. Storing index keys in shared memory allows minimize access to heap. So, when new key is coming, you should check overlap with each stored keys in shared memory. For each check result will be one of the following points:
- keys are not overlapped: you don't need to go to the heap. Suppose, this will
  be most frequent result in typical usecases.
- keys may be overlapped (consistentFn returns true and needRecheck flag is
  true): you should go to the heap to consult with original value (may be
  visibility too)
- keys are overlapped (consistentFn returns true and needRecheck flag is false):
  heap visit is needed only for checking visibility


If you don't store keys in shared memory, then you should consult with heap for each stored key.
--
Teodor Sigaev                                   E-mail: [EMAIL PROTECTED]
                                                   WWW: http://www.sigaev.ru/

--
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