Re: [HACKERS] Proposal: GiST constraints

2008-06-10 Thread Teodor Sigaev
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 minimiz

Re: [HACKERS] Proposal: GiST constraints

2008-06-10 Thread Jeff Davis
On Tue, 2008-06-10 at 16:59 +0400, Teodor Sigaev wrote: > > This can be solved by my proposal, but I just don't know how it would > > apply to something like GIN, for instance. It could replace the unique > Hmm, your proposal isn't applicable to GIN, because GIN stores a lot of keys > for > only

Re: [HACKERS] Proposal: GiST constraints

2008-06-10 Thread Teodor Sigaev
This can be solved by my proposal, but I just don't know how it would apply to something like GIN, for instance. It could replace the unique Hmm, your proposal isn't applicable to GIN, because GIN stores a lot of keys for only one value to be indexed. being inserted by other concurrent transac

Re: [HACKERS] Proposal: GiST constraints

2008-06-10 Thread Teodor Sigaev
I would like to consider adding constraints to GiST indexes. I think it is possible to add constraints that are more sophisticated than just UNIQUE. My use case is a non-overlapping constraint, but I think it's possible for this to be more general. Sounds good The idea is to make an array in sh

Re: [HACKERS] Proposal: GiST constraints

2008-06-09 Thread Jeff Davis
On Mon, 2008-06-09 at 21:00 -0400, Tom Lane wrote: > 1. It's btree-specific and can't be shared by other index AMs that might > wish to implement constraints. > This can be solved by my proposal, but I just don't know how it would apply to something like GIN, for instance. It could replace the un

Re: [HACKERS] Proposal: GiST constraints

2008-06-09 Thread Tom Lane
Jeff Davis <[EMAIL PROTECTED]> writes: > On Mon, 2008-06-09 at 13:28 -0400, Tom Lane wrote: >> I would like to see something that replaces the current btree-only kluge >> for UNIQUE, if we're going to try to do something "general". IOW, don't >> think of this as GiST-specific. > I'm not sure exac

Re: [HACKERS] Proposal: GiST constraints

2008-06-09 Thread Jeff Davis
On Mon, 2008-06-09 at 13:28 -0400, Tom Lane wrote: > Jeff Davis <[EMAIL PROTECTED]> writes: > > I would like to consider adding constraints to GiST indexes. I think it > > is possible to add constraints that are more sophisticated than just > > UNIQUE. My use case is a non-overlapping constraint, b

Re: [HACKERS] Proposal: GiST constraints

2008-06-09 Thread Tom Lane
Jeff Davis <[EMAIL PROTECTED]> writes: > I would like to consider adding constraints to GiST indexes. I think it > is possible to add constraints that are more sophisticated than just > UNIQUE. My use case is a non-overlapping constraint, but I think it's > possible for this to be more general. I

[HACKERS] Proposal: GiST constraints

2008-06-09 Thread Jeff Davis
I would like to consider adding constraints to GiST indexes. I think it is possible to add constraints that are more sophisticated than just UNIQUE. My use case is a non-overlapping constraint, but I think it's possible for this to be more general. The idea is to make an array in shared memory wi