[sqlite] BLOB Incremental IO

2008-10-31 Thread ??????? ????????
I have a problem with BLOB writing. I need to write some binary stream into sqlite table. As I understood, incremental BLOB I/O requires space of constant size to be preallocated with zeroblob, but I don't know the size of stream in advance. And sqlite doesn't allow to change the size of BLOB

Re: [sqlite] BLOB Incremental IO

2008-10-31 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 ??? wrote: > As I understood, incremental > BLOB I/O requires space of constant size to be preallocated > with zeroblob, That is correct. > but I don't know the size of stream in advance. Then you can't use the incremental I/O for

Re: [sqlite] Faster (can be shallow) "integrity_check"?

2008-10-31 Thread Dan
On Oct 31, 2008, at 6:34 PM, Zbigniew Baniewski wrote: > I would to make automatic test of the database integrity each time > before > accessing, just to avoid the problems with broken files, which are > resulting > in error message: "database disk image is malformed". > > Unfortunately,

Re: [sqlite] Unhappy with performance

2008-10-31 Thread Brad Stiles
> The problem is with bulk-updating: > > > # time sqlite3 kfzdb 'update kfz set musttrans=3' What happens when you run the update inside a transaction? ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Faster (can be shallow) "integrity_check"?

2008-10-31 Thread Zbigniew Baniewski
On Fri, Oct 31, 2008 at 06:43:29PM +0700, Dan wrote: > You could use "PRAGMA quick_check", which is similar to integrity_check > but runs more quickly. Yes, it's much faster - but still much too time-consuming to make it default (more than 10 additional seconds on ~300 MB database file). > Note

[sqlite] Size of a memory DB?

2008-10-31 Thread Christophe Leske
Hi, is there a way to get the size of a :memory: db in the sqlite3.exe command line interpreter? Or any other way? -- Christophe Leske www.multimedial.de - [EMAIL PROTECTED] http://www.linkedin.com/in/multimedial Lessingstr. 5 - 40227 Duesseldorf - Germany 0211 261 32 12 - 0177 249 70 31

Re: [sqlite] Size of a memory DB?

2008-10-31 Thread Christophe Leske
> is there a way to get the size of a :memory: db in the sqlite3.exe > command line interpreter? > Or any other way? > Also, would using a small PRAGMA page_size value decrease the amount of memory used? I think the default size is 4096 bytes, how about 512 bytes for an in-memory database

[sqlite] Unhappy with performance

2008-10-31 Thread Marian Aldenhoevel
Hi, I have tried converting a program from a homebrew "database" to sqlite3 for easier maintenance and hopefully better performance. While the former is easily achieved, the performance is not making me happy. The system is a "semi-embedded" small form-factor x86 machine with 128MB of RAM

Re: [sqlite] Unhappy with performance

2008-10-31 Thread Marian Aldenhoevel
Hi, > Considering that all or most of the records have the same value in > musttrans column, do you really need an index on it? Try dropping the > index, see if it helps. They have the same value in my test. In the real application that field is used as a status field and most of the records

Re: [sqlite] Unhappy with performance

2008-10-31 Thread MikeW
Marian Aldenhoevel <[EMAIL PROTECTED]> writes: > > Hi, > > I have tried converting a program from a homebrew "database" to sqlite3 > for easier maintenance and hopefully better performance. While the > former is easily achieved, the performance is not making me happy. The > system is a

Re: [sqlite] Unhappy with performance

2008-10-31 Thread Igor Tandetnik
"Marian Aldenhoevel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > CREATE INDEX IF NOT EXISTS IDX_KFZ_MUSTRANS ON KFZ (mustTrans); > > The problem is with bulk-updating: > >> # time sqlite3 kfzdb 'update kfz set musttrans=3' >> real10m 7.75s >> user8m 49.73s >> sys 0m

Re: [sqlite] Unhappy with performance

2008-10-31 Thread Brad Stiles
> > What happens when you run the update inside a transaction? > I tried it like this: > > time sqlite3 kfzdb 'begin ; update kfz set musttrans=5 ; end' > No significant change in runtime either. Are you able to benchmark it using an actual PC's local hard drive? Just for comparison. To be

[sqlite] Faster (can be shallow) "integrity_check"?

2008-10-31 Thread Zbigniew Baniewski
I would to make automatic test of the database integrity each time before accessing, just to avoid the problems with broken files, which are resulting in error message: "database disk image is malformed". Unfortunately, "PRAGMA integrity_check" takes very long time. Does there exist any

Re: [sqlite] Unhappy with performance

2008-10-31 Thread Marian Aldenhoevel
Hi, > Are you able to benchmark it using an actual PC's local hard drive? > Just for comparison. To be fair, you'd have to use the same build of > sqlite, or at one that was built the same way. That would be quite an effort. For a quick data-point I copied the database file to my

Re: [sqlite] Unhappy with performance

2008-10-31 Thread John Elrick
Marian Aldenhoevel wrote: > Hi, > > >> Are you able to benchmark it using an actual PC's local hard drive? >> Just for comparison. To be fair, you'd have to use the same build of >> sqlite, or at one that was built the same way. >> > > That would be quite an effort. > > For a quick

Re: [sqlite] insert speeds slowing down as database size increases (newb)

2008-10-31 Thread John Stanton
You canot have constant time inserts into a B-Tree because of the inherent nature of the algorithm. Berkeley DB has either B-Tree or hashed indices. The unordered hashed indices are possibly what you measured. Note that B-Trees have the additional property that they maintain an order and

Re: [sqlite] Unhappy with performance

2008-10-31 Thread Marian Aldenhövel
Hi, > FWIW, I ran your simple example on a Windows XP machine through the Ruby > driver and got 8 seconds for the update. Scaling that down to the hardware being used, which is a 486-clone with a 16bit bus showing as running at 31 BogoMIPS in linux (don't know the clockspeed), propably kills

Re: [sqlite] Unhappy with performance

2008-10-31 Thread Brad Stiles
>> Are you able to benchmark it using an actual PC's local hard drive? >> Just for comparison. To be fair, you'd have to use the same build of >> sqlite, or at one that was built the same way. > > That would be quite an effort. Just a thought. Since the build for your device is likely to be

Re: [sqlite] Unhappy with performance

2008-10-31 Thread John Stanton
It does not look like you are using transactions. Marian Aldenhoevel wrote: > Hi, > > I have tried converting a program from a homebrew "database" to sqlite3 > for easier maintenance and hopefully better performance. While the > former is easily achieved, the performance is not making me

Re: [sqlite] Unhappy with performance

2008-10-31 Thread John Elrick
Marian Aldenhövel wrote: > Hi, > > >> FWIW, I ran your simple example on a Windows XP machine through the Ruby >> driver and got 8 seconds for the update. >> > > Scaling that down to the hardware being used, which is a 486-clone with > a 16bit bus showing as running at 31 BogoMIPS in

[sqlite] About select by "=" condition to a string

2008-10-31 Thread yoky
Hi all, I create a table like this "create table tbl1 (ID integer primary key, name, addr)" , then insert a record: "insert into tbl1 values(1, 'aa', 'bb')", select the record: "select * from tbl1 where name ='aa' " ,can get this record : (1, 'aa',

Re: [sqlite] About select by "=" condition to a string

2008-10-31 Thread Derrell Lipman
On Fri, Oct 31, 2008 at 9:06 AM, yoky <[EMAIL PROTECTED]> wrote: > Hi all, >I create a table like this "create table tbl1 (ID integer primary > key, name, addr)" , >then insert a record: > "insert into tbl1 values(1, 'aa', 'bb')", > select the record: >

Re: [sqlite] Unhappy with performance

2008-10-31 Thread John Stanton
Since you just use one table you have no compelling reason to use a DB and could use a simple index file. I would expect your update of 300,000 records in that case to only take a few seconds. The footprint would also be far less. Something like D-ISAM would do the job. Note that you would

[sqlite] "SQL logic error or missing database" with multithreaded program

2008-10-31 Thread dbikash
Hello, I am writing a program using SQLite that uses two threads performing the following operations in an infinite loop: - Thread 1 inserts 500 records to the database every 30 seconds and then goes to sleep. (I prepare an insert statement, BEGIN TRANSACTION, bind values, step through the

Re: [sqlite] "SQL logic error or missing database" with multithreaded program

2008-10-31 Thread MikeW
dbikash <[EMAIL PROTECTED]> writes: > > > Hello, > ... > - Thread 1 inserts 500 records to the database every 30 seconds and then > goes to sleep. (I prepare an insert statement, BEGIN TRANSACTION, bind > values, step through the statement, reset the statement, and do END > TRANSACTION) >

Re: [sqlite] "SQL logic error or missing database" with multithreaded program

2008-10-31 Thread dbikash
I prepare the statement once. But I use transaction for every bunch of 500 record inserts. mikewhit wrote: > > dbikash <[EMAIL PROTECTED]> writes: > >> >> >> Hello, >> ... >> - Thread 1 inserts 500 records to the database every 30 seconds and then >> goes to sleep. (I prepare an insert

Re: [sqlite] "SQL logic error or missing database" with multithreaded program

2008-10-31 Thread D. Richard Hipp
On Oct 31, 2008, at 9:46 AM, dbikash wrote: > > I get a SQLite error 1 (SQL logic error > or missing database). What could be the problem? Is that the error message text that SQLite returns: "SQL logic error or missing database"? Or is that just the meaning of SQLITE_ERROR that you looked

[sqlite] Convert integer IP address to string IP address in Sqlite

2008-10-31 Thread Jonathon
Hello all, I was just curious if there is a way to convert an integer representation of an IP address that I store in my DB, to it's string equivalent (xxx.xxx.xxx.xxx)? I would also need to convert it to host-byte order as well. Thanks, J ___

Re: [sqlite] Convert integer IP address to string IP address in Sqlite

2008-10-31 Thread Igor Tandetnik
Jonathon <[EMAIL PROTECTED]> wrote: > I was just curious if there is a way to convert an integer > representation of an IP address that I store in my DB, to it's string > equivalent (xxx.xxx.xxx.xxx)? I would also need to convert it to > host-byte order as well. select (ip >> 24) || '.' || ((ip

Re: [sqlite] "SQL logic error or missing database" with multithreaded program

2008-10-31 Thread dbikash
I use both int sqlite3_errcode() and sqlite3_errmsg(). Here is what they return (I get 3 different types of errors in different runs): 1, SQL logic error or missing database. 1, unrecognized token "" (there's a non printable character like a rectangle within the quotes). 1, SQL logic error or

[sqlite] Checking column constraints

2008-10-31 Thread Mauricio
Hi, Is there any function or sql command that allows me to check which tables has a table and what are the constraints to those columns? Thanks, Maurício ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] "SQL logic error or missing database" with multithreaded program

2008-10-31 Thread Ken
I think you should consider running the program with one thread at a time. This will help you isolate if this is a problem within a thread or is an interaction among the threads. I'll assume its both. After you fix all of the localized issues. I'd suggest recompiling sqlite with thread safe

Re: [sqlite] Checking column constraints

2008-10-31 Thread Martin Engelschalk
Hello Mauricio, i do not understand your question. Perhaps you will want to rephrase it. The table "sqlite_master" can tell you how the tables were created. See http://www.sqlite.org/sqlite.html or http://www.sqlite.org/faq.html, and search for "sqlite_master". Martin Mauricio wrote: > Hi, >

Re: [sqlite] Checking column constraints

2008-10-31 Thread Mauricio
(I should have said "which tables has a database"... Sorry.) Suppose I've created a table with create table mytable (id unique, somethingelse) Is it possible somehow to check after reopening the database that mytable 'id' column was created with the 'unique' constraint? I want to use that to

Re: [sqlite] SQLite on Nintndo DS?

2008-10-31 Thread Sherief N. Farouk
> I have the DevKit and all the goodies and am able to make the DS jump > though > hoops. But I always have trouble with SQLite. I'm one of those who gets > the > very irritating huge numbers of compile errors that have something to > do with > compiler version versus SQLite version versus header

Re: [sqlite] BLOB Incremental IO

2008-10-31 Thread Sherief N. Farouk
> I have a problem with BLOB writing. I need to write > some binary stream into sqlite table. As I understood, incremental > BLOB I/O requires space of constant size to be preallocated > with zeroblob, but I don't know the size of stream in advance. > And sqlite doesn't allow to change the size of

Re: [sqlite] Checking column constraints

2008-10-31 Thread Igor Tandetnik
"Mauricio" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Suppose I've created a table with > > create table mytable (id unique, somethingelse) > > Is it possible somehow to check after reopening > the database that mytable 'id' column was created > with the 'unique' constraint? I

Re: [sqlite] About select by "=" condition to a string

2008-10-31 Thread yoky
> Hi all, >I create a table like this "create table tbl1 (ID integer primary > key, name, addr)" , >then insert a record: > "insert into tbl1 values(1, 'aa', 'bb')", > select the record: > "select * from tbl1 where name ='aa' " ,can get this record : >