Hi all, after discusion with Jim, I was created frist draft of proposal for value encoding.
Pros: efectivity for numerical values including date and time Cons: poor for strings (can be worst then current), can be solved by apply RLE (not current) over final result. It is designed as simple (there is space for improovement, but general value distribution function should be know) and easy to implement. It is use data from record format to skip length storage where is posible. Control byte= code:3bits + Value:5bits Code Value Meaning ===== ======= 0 0 NULL 1 Float Nan 2-31 Unused 1 0 Fixed Binary (length comes from record format) 1-31 Unused 2 Int5 - (-16~15) from value 3 Int13 +1byte 4 Int21 +2bytes 5 Int29 +3bytes 6 Int37 +4bytes 7 Int45 +5bytes DataType in format structure: INT - stored by absolute value, fixed binary for INT greater than 2^45 VARCHAR - int (length) + bytes[lenght] CHAR - VARCHAR + fill space DATE - Value-'1.1.2016' stored as int (nuber of days) TIME - Time - '12:00:00' PM (noon) and stored as INT (what is requested precision?) TIMESTAMP - as DATE followed by TIME FLOAT - integer value stored as integer, else Fixed binary (4) DOUBLE PRECISION - integer value stored as integer, else Fixed binary (8) DECIMAL - Stored as INT BLOBID - stored as integer Record format: uint32 tr_id uint8 format <data> Any comments? Slavek -- Ing. Slavomir Skopalik Executive Head Elekt Labs s.r.o. Collection and evaluation of data from machines and laboratories by means of system MASA (http://www.elektlabs.cz/m2demo) ----------------------------------------------------------------- Address: Elekt Labs s.r.o. Chaloupky 158 783 72 Velky Tynec Czech Republic --------------------------------------------------------------- Mobile: +420 724 207 851 icq:199 118 333 skype:skopaliks e-mail:skopa...@elektlabs.cz http://www.elektlabs.cz ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel