On Tue, Nov 8, 2011 at 7:08 PM, Gabor Grothendieck
<ggrothendi...@gmail.com>wrote:

> On Tue, Nov 8, 2011 at 6:46 PM, Richard Hipp <d...@sqlite.org> wrote:
> > On Tue, Nov 8, 2011 at 5:50 PM, Gabor Grothendieck
> > <ggrothendi...@gmail.com>wrote:
> >
> >> In R, the RSQLite driver for SQLite currently has
> >> SQLITE_MAX_VARIABLE_NUMBER set to 999.  This is used by many people
> >> for many different projects and on different platforms and it seems
> >> that a number of these projects want a larger number.  Users don't
> >> compile this themselves so they are stuck with whatever number is
> >> compiled in for them.
> >>
> >> What are the considerations for setting this number?
> >>
> >> Is there any general advice that can be given on how to set this number?
> >>
> >
> > I just checked and it appears that MacOS Lion compiles it a 500000.
> >
> > Whenever you use a value like ?N, SQLite allocates an array of N objects,
> > each of 72 bytes in size.  So doing "SELECT ?500000" on Lion requires a
> > 36MB memory allocation (with its accompanying memset()).  That's really
> the
> > only downside to choosing a really large SQLITE_MAX_VARIABLE_NUMBER.
>
> If "SELECT ?500000" allocates 500000 * 72 bytes of memory then how
> does that relate to SQLITE_MAX_VARIABLE_NUMBER?
> SQLITE_MAX_VARIABLE_NUMBER did not seem to enter the calculation at
> all.
>

SQLITE_MAX_VARIABLE_NUMBER determines the largest N for which ?N will
work.  So by default, the maximum allocation is 999*72.  You can increase
this to whatever you are comfortable with.


>
> --
> Statistics & Software Consulting
> GKX Group, GKX Associates Inc.
> tel: 1-877-GKX-GROUP
> email: ggrothendieck at gmail.com
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to