Re: Pysqlite tables in RAM

2006-10-05 Thread Ranjitha

Fredrik Lundh wrote:

> Ranjitha wrote:
>
> > I want to store my data in a database on the disk. I also want to be
> > able to reload the tables into the RAM whenever I have a lot of disk
> > accesses and commit the changes back to the database.
>
> using the cache_size and synchronous pragmas sounds like a better way to
> trade reliability against speed/memory use.  e.g.
>
> table_memory = 1 # bytes
> cur.execute("pragma cache_size = %d;" % (table_memory / 1500))
>
> ...
>
> cur.execute("pragma synchronous = off;")
> # do lots of stuff
> cur.execute("pragma synchronous = full;")
>
> for more on this, see: http://www.sqlite.org/pragma.html
>
> 

Thanks a lot for the help but could you please elaborate on this. I'm
finding it difficult to follow the link you sent me. The jargon seems
all too new for me. 

Thanks,
Ranjitha

-- 
http://mail.python.org/mailman/listinfo/python-list


Pysqlite tables in RAM

2006-09-29 Thread Ranjitha
Hi all,

I'm relatively new to python and am facing a problem with database
access

I want to store my data in a database on the disk. I also want to be
able to reload the tables into the RAM whenever I have a lot of disk
accesses and commit the changes back to the database. There is an
option of storing the data in the RAM where you connect to :memory:
instead of a DB file. The problem with this is that the data is lost
everytime you close the connection to the database. Could somebody
suggest a way to load the tables into the RAM as tables and not as some
lists or dictionaries?

Thanks,
Simba

-- 
http://mail.python.org/mailman/listinfo/python-list