Re: [sqlite] Understanding how SQLite works

2008-08-28 Thread John Stanton
Sqlite maintains its data in a disk file.  It only reads and writes to 
that file sufficient bytes to maintain changes to the database or to 
satisfy the query.  It uses memory to cache data while it processes it 
and will write changed parts of that data back to the disk file.

Fundamentally Sqlite organizes data as "pages", fixed size chunks of the 
disk file.  It reads pages and writes back altered or freshly created ones.

[EMAIL PROTECTED] wrote:
> I understand that the SQLite database resides in memory.  I understand that
> the information in memory gets written to disk, ie saving parts that have
> been updated/whole database.
> 
> I have read that SQLite has been known to support up 100,000 concurrent
> read connections and can support several terabytes of data.
> 
> Now lets say a database is 10Gb in size and it is written to disk.  Would
> not writing a 10Gb file to disk take a very long time?
> 
> Now perhaps SQLite can just write the part that has changed to disk.
> 
> If this is the case, then how does it know which sectors on the hard drive
> to update since it isn't writing the entire file to disk
> 
> Can someone explain to me how all of this work?
> 
> Thanks,
> TD
> 
> 
> mail2web.com - Microsoft® Exchange solutions from a leading provider -
> http://link.mail2web.com/Business/Exchange
> 
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Understanding how SQLite works

2008-08-28 Thread Darrell Lee
Igor Tandetnik wrote:
> <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>   
>> I understand that the SQLite database resides in memory.
>> 
>
> Not usually, no. There's an in-memory cache of recently accessed pages, 
> but most of the database (especially a large database) remains on disk.
>
>   
>> Now lets say a database is 10Gb in size and it is written to disk.
>> Would not writing a 10Gb file to disk take a very long time?
>> 
>
> Probably.
>
>   
>> Now perhaps SQLite can just write the part that has changed to disk.
>> 
>
> It can.
>
>   
>> If this is the case, then how does it know which sectors on the hard
>> drive to update since it isn't writing the entire file to disk
>> 
>
> Well, that's the job of a DBMS - to know which rows have changed, and 
> where in the file they should be stored. That's the whole point of the 
> exercise.
>
>   
>> Can someone explain to me how all of this work?
>> 
>
> See if this helps: http://sqlite.org/arch.html . And if you really want 
> to know how _all_ of this works, you can always study the source code.
>   
Thanks

-- 
Darrell Lee
Advanced Data Systems, Inc.
119 Honeysuckle Drive
Greenville. SC 29609

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Understanding how SQLite works

2008-08-27 Thread Igor Tandetnik
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I understand that the SQLite database resides in memory.

Not usually, no. There's an in-memory cache of recently accessed pages, 
but most of the database (especially a large database) remains on disk.

> Now lets say a database is 10Gb in size and it is written to disk.
> Would not writing a 10Gb file to disk take a very long time?

Probably.

> Now perhaps SQLite can just write the part that has changed to disk.

It can.

> If this is the case, then how does it know which sectors on the hard
> drive to update since it isn't writing the entire file to disk

Well, that's the job of a DBMS - to know which rows have changed, and 
where in the file they should be stored. That's the whole point of the 
exercise.

> Can someone explain to me how all of this work?

See if this helps: http://sqlite.org/arch.html . And if you really want 
to know how _all_ of this works, you can always study the source code.
-- 
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925 



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Understanding how SQLite works

2008-08-27 Thread [EMAIL PROTECTED]
I understand that the SQLite database resides in memory.  I understand that
the information in memory gets written to disk, ie saving parts that have
been updated/whole database.

I have read that SQLite has been known to support up 100,000 concurrent
read connections and can support several terabytes of data.

Now lets say a database is 10Gb in size and it is written to disk.  Would
not writing a 10Gb file to disk take a very long time?

Now perhaps SQLite can just write the part that has changed to disk.

If this is the case, then how does it know which sectors on the hard drive
to update since it isn't writing the entire file to disk

Can someone explain to me how all of this work?

Thanks,
TD


mail2web.com - Microsoft® Exchange solutions from a leading provider -
http://link.mail2web.com/Business/Exchange


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users