Re: What is the maximum IBTree key my system can use?

Éloi Rivard <[email protected]> Tue, 8 Jan 2019 09:09:40 -0800 (PST)
Newsgroups gmane.comp.web.zope.zodb
Message-ID <[email protected]>
------=_Part_2096_234331639.1546967380986
Content-Type: multipart/alternative; 
	boundary="----=_Part_2097_825068061.1546967380986"

------=_Part_2097_825068061.1546967380986
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable


>
> Pick integer values for keys between BTrees.family64.minint=20
> and  BTrees.family64.maxint.
>

This code raises *TypeError: integer out of range*
IOBTree()[BTrees.family64.maxint-1] =3D True

Why do you need 128-bit support?  If you want to use UUIDs as keys, use an=
=20
> OOBTree, or possibly a composition of pair of LOBTrees (one for UUID stri=
ng=20
> to long index, one for long to object).
>

So this one is another problem. As it is written in the bug report, "the=20
BTrees documentation advises that we can also use data structures=20
specialized to integers, which are faster and use less memory", so I would=
=20
prefer to use a LOBTree than an OOBTree.=20

> On Jan 8, 2019, at 8:12 AM, =C3=89loi Rivard <[email protected] <javascrip=
t:>>=20
> wrote:
>
> Hi.
> *IOBTree()[(2**32)-1] =3D True* is raising a TypeError on my computer, an=
d=20
> in fact it seems the maximum key I can use is 2**31-1
>
>    - Is there a constant somewhere indicating the maximum key I can use=
=20
>    in a IOBTree? I found that IBTreeFamily implements a maxint parameter,=
 but=20
>    how can I know which family I am using?=20
>    <https://pythonhosted.org/BTrees/_modules/BTrees/Interfaces.html#IBTre=
eFamily>
>    - Is the maximum value the same for everyone? If no, how could I=20
>    increase this value?
>    - Also, what are your thoughts on 128-bit support=20
>    <https://www.google.com/url?q=3Dhttps%3A%2F%2Fgithub.com%2Fzopefoundat=
ion%2FBTrees%2Fissues%2F100&sa=3DD&sntz=3D1&usg=3DAFQjCNGZrZF1SMHpTh_z6G72E=
m4rHnP8Qg>
>    ?
>
>
> Thank you!
> =C3=89loi Rivard
>
>
>
> --=20
> You received this message because you are subscribed to the Google Groups=
=20
> "zodb" group.
> To unsubscribe from this group and stop receiving emails from it, send an=
=20
> email to [email protected] <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
>
>
>

--=20
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 e=
mail to [email protected].
For more options, visit https://groups.google.com/d/optout.

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

<div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div style=3D=
"word-wrap:break-word;line-break:after-white-space"><div>Pick integer value=
s for keys between=C2=A0BTrees.family64.minint and=C2=A0=C2=A0BTrees.family=
64.maxint.<br></div></div></blockquote><div><br></div><div>This code raises=
 <i>TypeError: integer out of range</i><br></div><div><span style=3D"backgr=
ound-color: rgb(238, 238, 238);">IOBTree()[BTrees.family64.maxint-1] =3D Tr=
ue</span></div><div><br></div><blockquote class=3D"gmail_quote" style=3D"ma=
rgin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">=
<div style=3D"word-wrap:break-word;line-break:after-white-space"><div><div>=
</div><div>Why do you need 128-bit support? =C2=A0If you want to use UUIDs =
as keys, use an OOBTree, or possibly a composition of pair of LOBTrees (one=
 for UUID string to long index, one for long to object).</div></div></div><=
/blockquote><div><br></div><div><span style=3D"font-family: arial, sans-ser=
if;"><font size=3D"2">So this one is another problem. As it is written in t=
he bug report, &quot;the BTrees documentation advises that we can also use =
<code>data structures specialized to integers, which are faster and use les=
s memory&quot;</code></font></span>, so I would prefer to use a LOBTree tha=
n an OOBTree. <br></div><blockquote class=3D"gmail_quote" style=3D"margin: =
0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div s=
tyle=3D"word-wrap:break-word;line-break:after-white-space"><div><div><div><=
blockquote type=3D"cite"><div>On Jan 8, 2019, at 8:12 AM, =C3=89loi Rivard =
&lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"58-3=
VeOzEQAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;javascript:&#39;=
;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;return true;">a=
[email protected]</a>&gt; wrote:</div><br><div><div dir=3D"ltr"><div>Hi.</div=
><div><span style=3D"background-color:rgb(204,204,204)"><i><b>IOBTree()[(2*=
*32)-1] =3D True</b></i></span> is raising a TypeError on my computer, and =
in fact it seems the maximum key I can use is 2**31-1</div><ul><li>Is there=
 a constant somewhere indicating the maximum key I can use in a IOBTree? I =
found that IBTreeFamily implements a maxint parameter, but how can I know w=
hich family I am using?<a href=3D"https://pythonhosted.org/BTrees/_modules/=
BTrees/Interfaces.html#IBTreeFamily" target=3D"_blank" rel=3D"nofollow" onm=
ousedown=3D"this.href=3D&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2F=
pythonhosted.org%2FBTrees%2F_modules%2FBTrees%2FInterfaces.html%23IBTreeFam=
ily\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGfYw9Ggq3CMbR4yUKrOF5lQvm4fw&#3=
9;;return true;" onclick=3D"this.href=3D&#39;https://www.google.com/url?q\x=
3dhttps%3A%2F%2Fpythonhosted.org%2FBTrees%2F_modules%2FBTrees%2FInterfaces.=
html%23IBTreeFamily\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGfYw9Ggq3CMbR4y=
UKrOF5lQvm4fw&#39;;return true;"><span></span></a><br></li><li>Is the maxim=
um value the same for everyone? If no, how could I increase this value?</li=
><li>Also, what are your thoughts on <a href=3D"https://www.google.com/url?=
q=3Dhttps%3A%2F%2Fgithub.com%2Fzopefoundation%2FBTrees%2Fissues%2F100&amp;s=
a=3DD&amp;sntz=3D1&amp;usg=3DAFQjCNGZrZF1SMHpTh_z6G72Em4rHnP8Qg" target=3D"=
_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;https://www.google=
.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fzopefoundation%2FBTrees%2Fissues%2=
F100\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGZrZF1SMHpTh_z6G72Em4rHnP8Qg&#=
39;;return true;" onclick=3D"this.href=3D&#39;https://www.google.com/url?q\=
x3dhttps%3A%2F%2Fgithub.com%2Fzopefoundation%2FBTrees%2Fissues%2F100\x26sa\=
x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGZrZF1SMHpTh_z6G72Em4rHnP8Qg&#39;;return =
true;">128-bit support</a>?</li></ul><div><br></div><div>Thank you!<br></di=
v><div>=C3=89loi Rivard<br></div><div><br></div><div><br></div></div><div><=
br></div>

-- <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"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
58-3VeOzEQAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;javascript:&=
#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;return true=
;">zodb+uns...@googlegroups.<wbr>com</a>.<br>
For more options, visit <a href=3D"https://groups.google.com/d/optout" targ=
et=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;https://grou=
ps.google.com/d/optout&#39;;return true;" onclick=3D"this.href=3D&#39;https=
://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/=
d/<wbr>optout</a>.<br>
</div></blockquote></div><br></div></div></div></blockquote></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 />
For more options, visit <a href=3D"https://groups.google.com/d/optout">http=
s://groups.google.com/d/optout</a>.<br />

------=_Part_2097_825068061.1546967380986--

------=_Part_2096_234331639.1546967380986--