Re: size overhead to creating an opaque type.
Posted in 2003
Andrew, A good point. However, I would suggest the obvious - make your integer field the first field (and maybe serial?) in the table. A "key" that has to be 386 bytes long "might" be something like a pgp key, but I strongly suspect that even these are stored as a 2ndary key within any accessing structure (db, table, etc.). Andrew Hardy wrote: > It has been suggested that I create a multi-representational type. > > Given the status of various pre-existing software components, it may NOT > be permitted to make changes/additions to these types. > > It may help if I can clearly show that this type is at fault. It looks to > me that maxlen 386 should be Ok. > >>From the original message: > > does it look like this one is just done wrong, or might there > be another reason ? > > The Programmers Guide 10-6 suggests the max len is the maximum that will > ever be stored in the field, I would therefore have assumed that an index > would be needed only for this size, i.e. <390, i.e. Ok. > > can any one explain this ? > > > > > |---------+----------------------------> > | | "Andrew Hardy" | > | | <Andrew.Hardy@mar| > | | coni.com> | > | | Sent by: | > | | owner-informix-li| > | | st@iiug.org | > | | | > | | | > | | 13/11/2003 16:15 | > | | | > |---------+----------------------------> > >--------------------------------------------------------------------------------------------------------------------------------------------------| > | | > | To: informix-list@iiug.org | > | cc: | > | Subject: size overhead to creating an opaque type. | > >--------------------------------------------------------------------------------------------------------------------------------------------------| > > > > > I have an opaque type as follows: > > create opaque type AsnOctetString384( > maxlen = 386, > alignment = 4 > ); > > I am unable to create an index on a field of this type and get -517. > > I am dicerning that this has been stored in the database as size 392 (too > big to create an index!). > > Since the total for my row is 906 and I have the following: > > varchar(255) > varchar(255) > integer i.e. 4 > AsnOctetString384 must be 392. > > Total 906 > > I didn't write this opaque type, but my understanding was that this and > other types had been specifically written to cater for indexes, upto a > maximum size, does it look like this one is just done wrong, or might there > be another reason ? > > Is it right that there is an overhead of 6 bytes above the maxlen size to > the creation of an opaque type ? > > The Programmers Guide 10-6 suggests the max len is the maximum that will > ever be stored in the field, I would therefore have assumed that an index > would be needed only for this size, i.e. <390, i.e. Ok. > > Can any one help ? > > Andrew H. > > > > > > sending to informix-list > > > > > > sending to informix-list > -- ( ______ )) .-- Scott MacKenzie; Dine' College ISD --. >===<--. C|~~| (>--- Phone/Voice Mail: 928-724-6639 ---<) | ; o |-' | | \\--- Senior DBA/CARS Coordinator/Etc. --/ | _ | `--' `-- E: scottm at dinecollege dot edu -' `-----' sending to informix-list