Re: Dept of ugly hacks: eliminating padding space in system indexes
От | Tom Lane |
---|---|
Тема | Re: Dept of ugly hacks: eliminating padding space in system indexes |
Дата | |
Msg-id | 4890.1214264752@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Dept of ugly hacks: eliminating padding space in system indexes (Simon Riggs <simon@2ndquadrant.com>) |
Список | pgsql-hackers |
Simon Riggs <simon@2ndquadrant.com> writes: > On Mon, 2008-06-23 at 15:52 -0400, Tom Lane wrote: >> Cutting a third off the size of a system index has got to be worth >> something, but is it worth a hack as ugly as this one? > Not doing it would be more ugly, unless there is some negative > side-effect? I thought some more about why this seems ugly to me, and realized that a lot of it has to do with the change in typalign. Currently, a compiler is entitled to assume that a pointer to Name is 4-byte aligned; thus for instance it could generate word-wide instructions for copying a Name from one place to another. A "Name" that is stored as just CSTRING might break that. We are already at risk of this, really, because of all the places where we gaily pass plain old C strings to syscache and index searches on Name columns. I think the only reason we've not been burnt is that it's hard to optimize strcmp() into word-wide operations. However the solution to that seems fairly obvious: let's downgrade Name to typalign 1 instead of 4. regards, tom lane
В списке pgsql-hackers по дате отправления: