From: | Nikolay Shaplov <dhyan(at)nataraj(dot)su> |
---|---|
To: | Michael Paquier <michael(at)paquier(dot)xyz> |
Cc: | pgsql-hackers(at)lists(dot)postgresql(dot)org, Amit Langote <amitlangote09(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Dent John <denty(at)qqdd(dot)eu>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, "Iwata, Aya" <iwata(dot)aya(at)jp(dot)fujitsu(dot)com>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com> |
Subject: | Re: [PATCH] Do not use StdRdOptions in Access Methods |
Date: | 2019-11-14 08:20:25 |
Message-ID: | 19443094.nXpzPnDVGH@x200m |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
В письме от четверг, 14 ноября 2019 г. 16:50:18 MSK пользователь Michael
Paquier написал:
> > I've changed the patch to use build_reloptions function and again propose
> > it to the commitfest.
>
> Thanks for the new patch. I have not reviewed the patch in details,
> but I have a small comment.
>
> > +#define SpGistGetFillFactor(relation) \
> > + ((relation)->rd_options ? \
> > + ((SpGistOptions *) (relation)->rd_options)->fillfactor : \
> > + SPGIST_DEFAULT_FILLFACTOR)
> > +
>
> Wouldn't it make sense to add assertions here to make sure that the
> relkind is an index? You basically did that in commit 3967737.
For me there is no mush sense in it, as it does not prevent us from wrong type
casting. Indexes can use all kinds of structures for reloptions, and checking
that this is index, will not do much.
Do you know way how to distinguish one index from another? If we can check in
assertion this is index, and this index is spgist, then assertion will make
sense for 100%. I just have no idea how to do it. As far as I can see it is
not possible now.
Another issue here is, that we should to it to all indexes, not only that have
been using StdRdOptions, but to all indexes we have. (Damn code
inconsistency). So I guess this should go as another patch to keep it step by
step improvements.
--
Software Developer: https://www.upwork.com/freelancers/~014a87e140ff02c0da
Body-oriented Therapist: https://vk.com/nataraj_rebalancing (Russian)
From | Date | Subject | |
---|---|---|---|
Next Message | Rushabh Lathia | 2019-11-14 09:57:42 | Re: Optimize partial TOAST decompression |
Previous Message | Kyotaro Horiguchi | 2019-11-14 08:14:51 | Re: Coding in WalSndWaitForWal |