Subject Re: [firebird-support] Re: Data type for flags
Author Marcin Bury
It won't make a difference when you have "longer" db object names - it
makes sense when you keep them as short as possible. Two, three
characters more in names and your "optimization" for flag fields is
gone... ;-)

I use integer or bigint for flags (it depends on primary key data type),
since my "final" flag is - primary_key_value. Then I can set indexes on
such flag fields and quickly select records in certain state...

HTH
Marcin


ainpoissee pisze:
> --- In firebird-support@yahoogroups.com, Dimitry Sibiryakov <sd@...> wrote:
>> Use Integer.
>
> It would send 4 bytes while one would do... as I sayd a lot of those records would be sent back and forth between client and serves and to optimize for speed I want to make the size of one row as small as possible. I know it looks like a premature optimization but my past expierence is that pulling data from DB is the main bottleneck in the kind of app I'm creating.
>
> If there is a good reason not to use CHAR(1) then at least SMALLINT would be better than INTEGER in case only 8 bits is required, no?
>
> BTW, I now noted that size of NUMERIC and DECIMAL is documented as "variable, 16, 32 or 64 bits" so perhaps NUMERIC(1) is still a good way to go?
>
>
> TIA
> ain
>
>
>
> ------------------------------------
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Yahoo! Groups Links
>
>
>