fixed-length-string vs unsigned integer table with compression

Peng Yu <[email protected]> Mon, 17 Aug 2020 10:31:33 -0700 (PDT)
Newsgroups gmane.comp.web.zope.zodb
Message-ID <[email protected]>
------=_Part_866_1389064971.1597685493836
Content-Type: multipart/alternative; 
	boundary="----=_Part_867_552910598.1597685493837"

------=_Part_867_552910598.1597685493837
Content-Type: text/plain; charset="UTF-8"

I'd like to storage a table with two fields, namely, a fixed-length-string 
(say of length 3) field and an unsigned integer field.

The uintegers corresponding to a given length-three-string are always 
unique. And computing the diff between ordered uintegers then saving the 
diffs as a varuint will significantly reduce storage size.

https://sqlite.org/src4/doc/trunk/www/varint.wiki

The search will always be by a length-three-string for exact match to get 
all the corresponding ordered uintegers.

However, the insertion will be by the uinteger. That is, for insertion, the 
input will be a uinteger and the corresponding length-three-strings.

For deletion of a given uinteger, all the appearances of the uinteger in 
the database will be deleted.

In classical B-tree, the search and insert/delete correspond to the same 
fields. But in this case, the search and the insert/delete correspond to 
two different fields. So I am not what is the best data structure. Could 
anybody let me whether zodb is appropriate for this application? If not, 
what data structure is the most appropriate for this application? Thanks.

-- 
You received this message because you are subscribed to the Google Groups "zodb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/zodb/5ded0c82-1474-4e07-a224-a77d9e40c102o%40googlegroups.com.

------=_Part_867_552910598.1597685493837
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>I&#39;d like to storage a table with two fields, name=
ly, a fixed-length-string (say of length 3) field and an unsigned integer f=
ield.</div><div><br></div><div>The uintegers corresponding to a given lengt=
h-three-string are always unique. And computing the diff between ordered ui=
ntegers then saving the diffs as a varuint will significantly reduce storag=
e size.</div><div><br></div><div>https://sqlite.org/src4/doc/trunk/www/vari=
nt.wiki</div><div><br></div><div>The search will always be by a length-thre=
e-string for exact match to get all the corresponding ordered uintegers.<br=
></div><div><br></div><div>However, the insertion will be by the uinteger. =
That is, for insertion, the input will be a uinteger and the corresponding =
length-three-strings.</div><div><br></div><div>For deletion of a given uint=
eger, all the appearances of the uinteger in the database will be deleted.<=
/div><div><br></div><div>In classical B-tree, the search and insert/delete =
correspond to the same fields. But in this case, the search and the insert/=
delete correspond to two different fields. So I am not what is the best dat=
a structure. Could anybody let me whether zodb is appropriate for this appl=
ication? If not, what data structure is the most appropriate for this appli=
cation? Thanks.<br></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;zodb&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">zodb+unsubscri=
[email protected]</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/d/msgid/zodb/5ded0c82-1474-4e07-a224-a77d9e40c102o%40googlegroups.com?ut=
m_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/zod=
b/5ded0c82-1474-4e07-a224-a77d9e40c102o%40googlegroups.com</a>.<br />

------=_Part_867_552910598.1597685493837--

------=_Part_866_1389064971.1597685493836--