Subject | RE: [firebird-support] binary or string? |
---|---|
Author | Storage Box |
Post date | 2004-12-11T19:03:53Z |
Excellent, thanks very much!
_____
From: Alexander Gräf [mailto:graef@...]
Sent: Saturday, December 11, 2004 11:50 AM
To: firebird-support@yahoogroups.com
Subject: AW: [firebird-support] binary or string?
*much* slower. Your only available options are INT64 or CHAR(8) BINARY.
Anyway, INT64 is faster when comparing, which is needed in table joins.
Simply use INT64, and don't fiddle arround with CHAR. There is simply one
big problem with using CHAR (xy) with binary data: Most database
administration tools are not aware of the fact that you are misusing string
fields for binary data. In my case, I'm not able to write a simple query
like this:
SELECT * FROM Table1 WHERE Uuid = '...';
Simply because '...' could contain null-chars and control-chars and other
stuff. It is easier to write this:
SELECT * FROM Table1 WHERE Int64PKEY = 26589734353;
In my case CHAR(xy) BINARY was the only option, in your case, you could use
both, but you *should* use Int64 data type.
Regards, Alex
Yahoo! Groups Sponsor
ADVERTISEMENT
<http://us.ard.yahoo.com/SIG=129of0n23/M=294855.5468653.6549235.3001176/D=gr
oups/S=1705115386:HM/EXP=1102877378/A=2455396/R=0/SIG=119u9qmi7/*http://smal
lbusiness.yahoo.com/domains/> click here
<http://us.adserver.yahoo.com/l?M=294855.5468653.6549235.3001176/D=groups/S=
:HM/A=2455396/rand=539460947>
_____
Yahoo! Groups Links
* To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/
* To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com
<mailto:firebird-support-unsubscribe@yahoogroups.com?subject=Unsubscribe>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .
[Non-text portions of this message have been removed]
_____
From: Alexander Gräf [mailto:graef@...]
Sent: Saturday, December 11, 2004 11:50 AM
To: firebird-support@yahoogroups.com
Subject: AW: [firebird-support] binary or string?
> -----Ursprüngliche Nachricht-----CHAR(16) (16 hexadecimal coded chars) is not for discussion, as it will be
> Von: Storage Box [mailto:spam@...]
> Gesendet: Samstag, 11. Dezember 2004 19:46
> An: firebird-support@yahoogroups.com
> Betreff: RE: [firebird-support] binary or string?
>
> My main concern is how efficiently they're stored in the DB.
> If joining two 64-bit integers together in a query is faster
> than two char(16) octets, than I'll take your advice. I
> would imagine it would be much faster as numeric comparisons
> are generally faster than character-based comparisons (in
> probably most modern databases).
*much* slower. Your only available options are INT64 or CHAR(8) BINARY.
Anyway, INT64 is faster when comparing, which is needed in table joins.
Simply use INT64, and don't fiddle arround with CHAR. There is simply one
big problem with using CHAR (xy) with binary data: Most database
administration tools are not aware of the fact that you are misusing string
fields for binary data. In my case, I'm not able to write a simple query
like this:
SELECT * FROM Table1 WHERE Uuid = '...';
Simply because '...' could contain null-chars and control-chars and other
stuff. It is easier to write this:
SELECT * FROM Table1 WHERE Int64PKEY = 26589734353;
In my case CHAR(xy) BINARY was the only option, in your case, you could use
both, but you *should* use Int64 data type.
Regards, Alex
Yahoo! Groups Sponsor
ADVERTISEMENT
<http://us.ard.yahoo.com/SIG=129of0n23/M=294855.5468653.6549235.3001176/D=gr
oups/S=1705115386:HM/EXP=1102877378/A=2455396/R=0/SIG=119u9qmi7/*http://smal
lbusiness.yahoo.com/domains/> click here
<http://us.adserver.yahoo.com/l?M=294855.5468653.6549235.3001176/D=groups/S=
:HM/A=2455396/rand=539460947>
_____
Yahoo! Groups Links
* To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/
* To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com
<mailto:firebird-support-unsubscribe@yahoogroups.com?subject=Unsubscribe>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .
[Non-text portions of this message have been removed]