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

Sean Upton <[email protected]> Tue, 8 Jan 2019 10:53:54 -0700
Newsgroups gmane.comp.web.zope.zodb
Message-ID <[email protected]>
--Apple-Mail=_2DB57742-5F58-4096-BA9D-9BCB57355648
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"


> On Jan 8, 2019, at 10:09 AM, =C3=89loi Rivard <[email protected]> wrote:
> This code raises TypeError: integer out of range
> IOBTree()[BTrees.family64.maxint-1] =3D True

You are using the wrong class.  Try LOBTree explicitly, not IOBTree.

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

Then use an LOBTree, and use 64-bit (C long long) integers.  It is not unre=
asonable to suggest that you do not need 128 bit keys.

Sean


>> On Jan 8, 2019, at 8:12 AM, =C3=89loi Rivard <[email protected] <>> wrote=
:
>>=20
>> Hi.
>> IOBTree()[(2**32)-1] =3D True is raising a TypeError on my computer, and=
 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 in a =
IOBTree? I found that IBTreeFamily implements a maxint parameter, but how c=
an I know which family I am using? <https://pythonhosted.org/BTrees/_module=
s/BTrees/Interfaces.html#IBTreeFamily>
>> Is the maximum value the same for everyone? If no, how could I increase =
this value?
>> Also, what are your thoughts on 128-bit support <https://www.google.com/=
url?q=3Dhttps%3A%2F%2Fgithub.com%2Fzopefoundation%2FBTrees%2Fissues%2F100&s=
a=3DD&sntz=3D1&usg=3DAFQjCNGZrZF1SMHpTh_z6G72Em4rHnP8Qg>?
>>=20
>> Thank you!
>> =C3=89loi Rivard
>>=20
>>=20
>>=20
>> --=20
>> You received this message because you are subscribed to the Google Group=
s "zodb" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n email to [email protected] <>.
>> For more options, visit https://groups.google.com/d/optout <https://grou=
ps.google.com/d/optout>.
>=20
>=20
> --=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=
 email to [email protected] <mailto:zodb+unsubscribe@google=
groups.com>.
> For more options, visit https://groups.google.com/d/optout <https://group=
s.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.

--Apple-Mail=_2DB57742-5F58-4096-BA9D-9BCB57355648
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="UTF-8"

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; line-break: after-white-space;" class=3D""><br class=3D""><div><block=
quote type=3D"cite" class=3D""><div class=3D"">On Jan 8, 2019, at 10:09 AM,=
 =C3=89loi Rivard &lt;<a href=3D"mailto:[email protected]" class=3D"">azmeuk=
@gmail.com</a>&gt; wrote:</div><div class=3D""><div dir=3D"ltr" class=3D"">=
<div class=3D"">This code raises <i class=3D"">TypeError: integer out of ra=
nge</i><br class=3D""></div><div class=3D""><span style=3D"background-color=
: rgb(238, 238, 238);" class=3D"">IOBTree()[BTrees.family64.maxint-1] =3D T=
rue</span></div></div></div></blockquote><div><br class=3D""></div><div>You=
 are using the wrong class. &nbsp;Try LOBTree explicitly, not IOBTree.</div=
><br class=3D""><blockquote type=3D"cite" class=3D""><div class=3D""><div d=
ir=3D"ltr" class=3D""><blockquote class=3D"gmail_quote" style=3D"margin: 0;=
margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div sty=
le=3D"word-wrap:break-word;line-break:after-white-space" class=3D""><div cl=
ass=3D""><div class=3D""></div></div></div></blockquote><div class=3D""><sp=
an style=3D"font-family: arial, sans-serif;" class=3D""><font size=3D"2" cl=
ass=3D"">So this one is another problem. As it is written in the bug report=
, "the BTrees documentation advises that we can also use <code class=3D"">d=
ata structures specialized to integers, which are faster and use less memor=
y"</code></font></span>, so I would prefer to use a LOBTree than an OOBTree=
. <br class=3D""></div></div></div></blockquote><div><br class=3D""></div><=
div>Then use an LOBTree, and use 64-bit (C long long) integers. &nbsp;It is=
 not unreasonable to suggest that you do not need 128 bit keys.</div><div><=
br class=3D""></div><div>Sean</div><div><br class=3D""></div><br class=3D""=
><blockquote type=3D"cite" class=3D""><div class=3D""><div dir=3D"ltr" clas=
s=3D""><blockquote class=3D"gmail_quote" style=3D"margin: 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" class=3D""><div class=3D""><div c=
lass=3D""><div class=3D""><blockquote type=3D"cite" class=3D""><div class=
=3D"">On Jan 8, 2019, at 8:12 AM, =C3=89loi Rivard &lt;<a target=3D"_blank"=
 gdf-obfuscated-mailto=3D"58-3VeOzEQAJ" rel=3D"nofollow" class=3D"">azm...@=
gmail.com</a>&gt; wrote:</div><br class=3D""><div class=3D""><div dir=3D"lt=
r" class=3D""><div class=3D"">Hi.</div><div class=3D""><span style=3D"backg=
round-color:rgb(204,204,204)" class=3D""><i class=3D""><b class=3D"">IOBTre=
e()[(2**32)-1] =3D True</b></i></span> is raising a TypeError on my compute=
r, and in fact it seems the maximum key I can use is 2**31-1</div><ul class=
=3D""><li class=3D"">Is there a constant somewhere indicating the maximum k=
ey I can use in a IOBTree? I found that IBTreeFamily implements a maxint pa=
rameter, but how can I know which family I am using?<a href=3D"https://pyth=
onhosted.org/BTrees/_modules/BTrees/Interfaces.html#IBTreeFamily" target=3D=
"_blank" rel=3D"nofollow" class=3D""><span class=3D""></span></a><br class=
=3D""></li><li class=3D"">Is the maximum value the same for everyone? If no=
, how could I increase this value?</li><li class=3D"">Also, what are your t=
houghts on <a href=3D"https://www.google.com/url?q=3Dhttps%3A%2F%2Fgithub.c=
om%2Fzopefoundation%2FBTrees%2Fissues%2F100&amp;sa=3DD&amp;sntz=3D1&amp;usg=
=3DAFQjCNGZrZF1SMHpTh_z6G72Em4rHnP8Qg" target=3D"_blank" rel=3D"nofollow" c=
lass=3D"">128-bit support</a>?</li></ul><div class=3D""><br class=3D""></di=
v><div class=3D"">Thank you!<br class=3D""></div><div class=3D"">=C3=89loi =
Rivard<br class=3D""></div><div class=3D""><br class=3D""></div><div class=
=3D""><br class=3D""></div></div><div class=3D""><br class=3D""></div>

-- <br class=3D"">
You received this message because you are subscribed to the Google Groups "=
zodb" group.<br class=3D"">
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a target=3D"_blank" gdf-obfuscated-mailto=3D"58-3VeOzEQAJ" rel=3D"=
nofollow" class=3D"">zodb+uns...@googlegroups.<wbr class=3D"">com</a>.<br c=
lass=3D"">
For more options, visit <a href=3D"https://groups.google.com/d/optout" targ=
et=3D"_blank" rel=3D"nofollow" class=3D"">https://groups.google.com/d/<wbr =
class=3D"">optout</a>.<br class=3D"">
</div></blockquote></div><br class=3D""></div></div></div></blockquote></di=
v><div class=3D""><br class=3D"webkit-block-placeholder"></div>

-- <br class=3D"">
You received this message because you are subscribed to the Google Groups "=
zodb" group.<br class=3D"">
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]" class=3D"">zod=
[email protected]</a>.<br class=3D"">
For more options, visit <a href=3D"https://groups.google.com/d/optout" clas=
s=3D"">https://groups.google.com/d/optout</a>.<br class=3D"">
</div></blockquote></div><br class=3D""></body></html>

<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 />

--Apple-Mail=_2DB57742-5F58-4096-BA9D-9BCB57355648--