On Tue, Jul 19, 2005 at 02:02:28AM +0200, Dawid Kuroczko wrote: > On 7/18/05, Lincoln Yeoh <lyeoh@xxxxxxxxxxxxx> wrote: > > However, maybe padding for alignment is a waste on the disk - disks being > > so much slower than CPUs (not sure about that once the data is in memory ). > > Maybe there should be an option to reorder columns so that less space is > > wasted. > > Out of curiosity, do I understand right that if I create table > > CREATE TABLE sample1 ( > a boolean, > b int, > c boolean > ); > > ...it will take more storage than: > > CREATE TABLE sample2 ( > b int, > a boolean, > c boolean > ); > > ...I don't think such ordering should matter, but I would like to know > how it really is. :) Actually, I believe that's the case with just about every database, though of course each one has different alignment constraints. The point is that I don't know of any database that will silently re-order fields under the covers to optimize storage. -- Jim C. Nasby, Database Consultant decibel@xxxxxxxxxxx Give your computer some brain candy! www.distributed.net Team #1828 Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you guys coming, or what?" ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match