Subject | Re: [firebird-support] Is this possible ? |
---|---|
Author | Michael Ludwig |
Post date | 2010-05-31T16:54:16Z |
svanderclock schrieb am 31.05.2010 um 12:46:29 (-0000):
TINYINT as in MySQL). You might consider using a number of SMALLINT or
INTEGER to accommodate 2 respectively 4 fields each. This will require
some bit operations (BIN_SHL, BIN_AND, BIN_OR, etc), and it will also
suggest encapsulation of data access in stored procedures.
in each and every query, and (b) offer sufficient selectivity for index
efficiency. Then I would build that index, and no others.
--
Michael Ludwig
> I need to store 25 values (integer) in 25 differents fields.As far as I know, there is no 8-bit integer field in Firebird (such as
> all the value are from 0 to 255 (8bit). their will be at the end more
> than 50 000 000 rows in the table !
>
> What field definition to choose to store only 8 bit ?
TINYINT as in MySQL). You might consider using a number of SMALLINT or
INTEGER to accommodate 2 respectively 4 fields each. This will require
some bit operations (BIN_SHL, BIN_AND, BIN_OR, etc), and it will also
suggest encapsulation of data access in stored procedures.
> after i will select the field only in the wayTo be adapted and moved to the SP, I'd say.
>
> select ID from table colors where
> color1 > 120 and color1 < 140 and
> color2 > 160 and color2 < 180 and
> color3 > 60 and color3 < 80 and
> ...
> color25 > 20 and color25 < 40;
> is this will be acceptable under firebird ?I would try and figure out which of your 25 fields will (a) be present
> or too much heavy ? did i will need to create only
> one multi column index or 25 single column index ?
in each and every query, and (b) offer sufficient selectivity for index
efficiency. Then I would build that index, and no others.
--
Michael Ludwig