Subject Re: [firebird-support] Newbie question on how to hold an unusual data type
Author Carlos H. Cantu
Maybe storing it into a CHAR(22) using OCTECTS charset?

Helen's book describes octets as:

Bytes which will not be interpreted as characters. Useful for storing
binary data, GUID strings, hexidecimal numbers and for correcting
string data that is causing transliteration errors. Aliased as BINARY
from the “2” series onward.


Firebird Performance in Detail - -

bbmpcfs> Hi all,

bbmpcfs> I have volunteered to write a statistics-type program in
bbmpcfs> Lazarus/FreePascal under Linux and I need an embedded database, that
bbmpcfs> means it has to be Firebird. I've used a lot of database software
bbmpcfs> before, but never Firebird (nor Interbase, for that matter). I do NOT
bbmpcfs> want to force users to install a full-blown database server in order
bbmpcfs> to use the software.

bbmpcfs> My problem is that I must avoid duplicated records in the database,
bbmpcfs> the unique key is a complicated structure containing four 16-bit words
bbmpcfs> plus a 108-bit set of flags. The combination of the whole lot must be
bbmpcfs> unique. I don't need to retrieve this data other than to check for
bbmpcfs> duplicate records, so I can massage it in FreePascal so that it can go
bbmpcfs> into the database in any form that's desirable.

bbmpcfs> If I were using PostgreSQL, I'd store the whole lot as a single
bbmpcfs> 172-bit bitstring, but I can't find any mention of an equivalent data
bbmpcfs> type in the Firebird documentation that I've been able to find.

bbmpcfs> So, how would you store this data for greatest speed/efficiency in
bbmpcfs> checking for duplicates, please? I'm looking at a few million records
bbmpcfs> in the database, and there's a record size of around 350-400 bytes.

bbmpcfs> Thanks,

bbmpcfs> Brian.

bbmpcfs> ------------------------------------
bbmpcfs> Posted by: brian <brian@...>
bbmpcfs> ------------------------------------

bbmpcfs> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

bbmpcfs> Visit and click the Documentation item
bbmpcfs> on the main (top) menu. Try FAQ and other links from the left-side menu there.

bbmpcfs> Also search the knowledgebases at

bbmpcfs> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
bbmpcfs> ------------------------------------

bbmpcfs> Yahoo Groups Links