Unix Technical Forum

pg_am.amstrategies should be 0 when not meaningful?

This is a discussion on pg_am.amstrategies should be 0 when not meaningful? within the pgsql Hackers forums, part of the PostgreSQL category; --> GIST and GIN currently set their amstrategies entries to 100, which is a completely arbitrary number, since these index ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-12-2008, 06:00 AM
Tom Lane
 
Posts: n/a
Default pg_am.amstrategies should be 0 when not meaningful?

GIST and GIN currently set their amstrategies entries to 100, which is
a completely arbitrary number, since these index AMs don't impose any
particular interpretation on operator strategy numbers. Usually it's
far too large and results in wasted space in relcache entries. But it's
not impossible that it could be too small for a complex opclass.

I propose that we should set pg_am.amstrategies to zero when the index
AM doesn't have a fixed interpretation of strategy numbers. This would
make it clearer that there's no intended upper bound. It would also
cause the relcache not to bother trying to preload operator numbers,
which saves time and space --- neither of these AMs ever actually look
at the rd_operator array in relcache entries.

Comments? Can anyone think of anything that is likely to break?
(I can only see one or two trivial code adjustments that would be
needed.)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-12-2008, 06:01 AM
Teodor Sigaev
 
Posts: n/a
Default Re: pg_am.amstrategies should be 0 when not meaningful?

> I propose that we should set pg_am.amstrategies to zero when the index
> AM doesn't have a fixed interpretation of strategy numbers. This would
> make it clearer that there's no intended upper bound. It would also


Agreed. BTW, that also plays around possibility of grouping operator classes -
since GIN/GiST hasn't fixed strategy numbers, they opclasses can not be unioned
into group without extra agreement.

> Comments? Can anyone think of anything that is likely to break?
> (I can only see one or two trivial code adjustments that would be
> needed.)
>
> regards, tom lane


--
Teodor Sigaev E-mail: teodor@sigaev.ru
WWW: http://www.sigaev.ru/

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-12-2008, 06:01 AM
Tom Lane
 
Posts: n/a
Default Re: pg_am.amstrategies should be 0 when not meaningful?

Teodor Sigaev <teodor@sigaev.ru> writes:
>> I propose that we should set pg_am.amstrategies to zero when the index
>> AM doesn't have a fixed interpretation of strategy numbers. This would
>> make it clearer that there's no intended upper bound. It would also


> Agreed. BTW, that also plays around possibility of grouping operator
> classes - since GIN/GiST hasn't fixed strategy numbers, they opclasses
> can not be unioned into group without extra agreement.


Sure, but a group has to have agreement on semantics anyway ---
agreement on operator numbering would be part of that.

BTW, I've been looking at the built-in GIN array opclasses and wondering
if we couldn't make them a group. The advantage is that we'd need only
one pg_amop entry for each of the anyarray operators that are common to
all those classes. But you could also see that as a disadvantage,
because if the operators are "loose" in the group then there's no clear
indication that the individual opclasses depend on them. OTOH all these
entries will be marked pinned in pg_depend and so are undroppable, so
that disadvantage is largely academic.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:53 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com