Subject Re: [firebird-support] Re: FireBird 2.5 How can i create 1 byte (0-255) column?
Author Mark Rotteveel
On 6-4-2013 08:43, wan30032 wrote:
> thanks everyone.
>
> Now i do like this:
>
> Create Table T1 (IID BIGINT,
> I1 CHAR(1) CHARACTER SET OCTETS,
> I2 CHAR(1) CHARACTER SET OCTETS
> .... //200 Columns
> );
>
> and Creat Database with CHARACTER ASCII,PageSize 4096
>
> 1.How can i select column value?
> IID I1 I2 I3
> 1 ff 05 34
>
> select * from t1 where I1='ff' ?

Use X'ff'. See
http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/html/langrefupd25-hexbinstrings.html

> 2.Import Data
>
> i Create Files as HEX:
> like FileName 'c:\1.data'
> 01 00 00 00 00 00 00 00 FF 05 34 ... //200
> 02 00 00 00 00 00 00 00 1C 02 00 ... //200
>
> CREATE TABLE EXT1 EXTERNAL FILE 'c:\1.data'
> (IID BIGINT,
> I1 CHAR(1) CHARACTER SET OCTETS,
> I2 CHAR(1) CHARACTER SET OCTETS
> .... //200 Columns
> );
>
> insert into t1 select * from ext1;
>
> Now in my PC£¨windows 7 64+Firebird 2.5£©
> about 90 seconds can insert 2,000,000 records.
>
> so, how can become faster£¿

Try with a larger page size (eg 16 kilobytes instead of 4 kilobytes).
However you are already inserting at a rate of 22 records per
millisecond that is already quite fast; I am not sure if investing time
to make it even faster pays off.

Mark

--
Mark Rotteveel