[sqlite] In Mem Query Performance

2007-06-26 Thread RaghavendraK 70574
Hi, Thanks for the suggestion. But with that performance went down by 25% further. Pls suggest an alternative. Mr DRH says it is possible we can reach up to a million,if there is a way pls notify. regards ragha

Re: [sqlite] pragma page_count

2007-06-26 Thread Dan Kennedy
On Mon, 2007-06-25 at 17:08 -0500, Andrew Finkenstadt wrote: How easy would it be for me to implement a pragma page_count; statement which returns the CURRENT page count of the database, and is much more cross-platform than my attempt to just check the file size. Not difficult I would think.

[sqlite] where all indexing is used?

2007-06-26 Thread B V, Phanisekhar
Assume a table create table if not exists Title (Id INTEGER PRIMARY KEY, Titlename BLOB) create unique index if not exists TitleIdx ON Title (Titlename) For which all queries index TitleIdx will be used? * select Titlename from Title order by Titlename *

Re: [sqlite] where all indexing is used?

2007-06-26 Thread drh
B V, Phanisekhar [EMAIL PROTECTED] wrote: Assume a table create table Title ( Id INTEGER PRIMARY KEY, Titlename BLOB ) create unique index TitleIdx ON Title (Titlename) For which all queries index TitleIdx will be used? (1) select Titlename from Title order by Titlename (2)

[sqlite] LoadExtentions can't open DB

2007-06-26 Thread Andre du Plessis
I have been testing FTS2 and it is awesome I must say, hope that the project will keep going, I have this problem though: Once load extentions is enabled and fts2 is enabled, I cannot see anything in the DB anymore when I open it in SQLiteDatabaseBrowser. I CAN open it though, just cant see

Re: [sqlite] pragma page_count

2007-06-26 Thread Andrew Finkenstadt
On 6/26/07, Dan Kennedy [EMAIL PROTECTED] wrote: Compile, test, debug ... contribute. :)

Re: [sqlite] In Mem Query Performance

2007-06-26 Thread Joe Wilson
--- RaghavendraK 70574 [EMAIL PROTECTED] wrote: Thanks for the suggestion. But with that performance went down by 25% further. Pls suggest an alternative. Mr DRH says it is possible we can reach up to a million,if there is a way pls notify. ... We are using Sqlite in in Memory Mode and we

[sqlite] API enhancement proposal

2007-06-26 Thread Ken
I'd like to propose the following simple piece of code be added to sqlite. I believe it has some benefits for those who've wrapped the sqlite api's keeping copies in memory of the sql statement being executed. Add an api call that will return the saved SQL if using sqlite3_prepare_v2 or

Re: [sqlite] In Mem Query Performance

2007-06-26 Thread RaghavendraK 70574
Hi Joe, Your input is valuable. I will increase the pg size to 4KB and check. We just have a set of tables which is to be read on startup.No complex Query is involved. I find Sqlite to be most powerful given the size and complexity it handles. I use the following apis to create the int ret =

[sqlite] [Delphi] Escaping quote?

2007-06-26 Thread Gilles Ganault
Hello I'm having a problem saving strings into a colum from a Delphi application because they might contain the ( ' ) single quote character: = // Input := 'Let's meet at the pub tonight!'; MyFormat := 'insert into stuff (title) values ('''%s')'; SQL := Format(MyFormat, Input); try

Re: [sqlite] In Mem Query Performance

2007-06-26 Thread Joe Wilson
--- RaghavendraK 70574 [EMAIL PROTECTED] wrote: Your input is valuable. I will increase the pg size to 4KB and check. :memory: databases only use 1024 byte pages if I remember correctly, so it would have to be file based. We just have a set of tables which is to be read on startup.No complex

Re: [sqlite] [Delphi] Escaping quote?

2007-06-26 Thread John Elrick
Gilles Ganault wrote: Hello I'm having a problem saving strings into a colum from a Delphi application because they might contain the ( ' ) single quote character: = // Input := 'Let's meet at the pub tonight!'; MyFormat := 'insert into stuff (title) values ('''%s')'; SQL :=

Re: [sqlite] In Mem Query Performance

2007-06-26 Thread RaghavendraK 70574
Hello Joe, It is a server platform,Linux SuSE9 enterpraise edition. 4 CPU machine,8GB ram. We want load all the tables in to mem db of Sqlite.Achieve read performance of upto 5records/sec for the table data i had mentioned earlier. so it would have to be file based. I could not get it. Does

RE: [sqlite] LoadExtentions can't open DB

2007-06-26 Thread WHITE, DANIEL
I don't think the current build of SQLiteDatabaseBrowser has any FTS support, so it needs to be upto date. Daniel A. White { Kent State University: Computer Science major } { JMC TechHelp: Taylor Hall, server techie } { E-mail: [EMAIL PROTECTED] } { Colossians 3:17 } -Original Message-

Re: [sqlite] [Delphi] Escaping quote?

2007-06-26 Thread Ralf Junker
I'm having a problem saving strings into a colum from a Delphi application because they might contain the ( ' ) single quote character: Is there a function I should call either in SQLite or Delphi before running the SQL query? Why don't you use the '%q' operator of SQLite's sqlite3_mprintf?

[sqlite] Multiple connections - stale cache?

2007-06-26 Thread Mark Brown
Hi- We have a scenario where we have two different database connections to the same database. Each database connection is running on a separate thread, but in this situation, we are only using one connection at a time. We are finding that sometimes one database connection will do a select on

Re: [sqlite] In Mem Query Performance

2007-06-26 Thread Joe Wilson
:memory: databases only have a page size of 1024. Try various page_size settings for a file based database file and see what happens. I have no other suggestions. --- RaghavendraK 70574 [EMAIL PROTECTED] wrote: It is a server platform,Linux SuSE9 enterpraise edition. 4 CPU machine,8GB ram.

Re: [sqlite] In Mem Query Performance

2007-06-26 Thread RaghavendraK 70574
Ok. Will notify u once i complete the test. regards ragha ** This email and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is

Re: [sqlite] Multiple connections - stale cache?

2007-06-26 Thread drh
Mark Brown [EMAIL PROTECTED] wrote: Hi- We have a scenario where we have two different database connections to the same database. Each database connection is running on a separate thread, but in this situation, we are only using one connection at a time. We are finding that sometimes one

Re: [sqlite] [Delphi] Escaping quote?

2007-06-26 Thread John Elrick
Ralf Junker wrote: I'm having a problem saving strings into a colum from a Delphi application because they might contain the ( ' ) single quote character: Is there a function I should call either in SQLite or Delphi before running the SQL query? Why don't you use the '%q' operator of

Re: [sqlite] [Delphi] Escaping quote?

2007-06-26 Thread Clay Dowling
John Elrick wrote: // Input := 'Let's meet at the pub tonight!'; MyFormat := 'insert into stuff (title) values (%s)'; SQL := Format(MyFormat, QuotedStr(Input)); try ASQLite3DB1.Database := db; ASQLite3DB1.DefaultDir := ExtractFileDir(Application.ExeName); ASQLite3DB1.Open;

Re: [sqlite] Worked perfectly!

2007-06-26 Thread Dennis Cote
litenoob wrote: -- #/bin/sh ROW_ID=`sqlite3 test.db END insert into t values(1,2); select last_insert_rowid() from t limit 1; END ` echo ROW_ID=$ROW_ID -- ^ that worked perfectly. Thank you Nikola! FYI, the last part of the select is superfluous. You can simply do this: insert

RE: [sqlite] Multiple connections - stale cache?

2007-06-26 Thread Mark Brown
Thanks for the quick reply. Unfortunately, we are developing code on the vxWorks platform, so I don't think sample code would be of use. We have seen the problem for some time now...at least from 3.3.12. The submitter of the ticket appears to have the exact same scenario as us. Hopefully he

RE: [sqlite] Multiple connections - stale cache?

2007-06-26 Thread Joe Wilson
Can you list all the compile flags you used to compile the sqlite3 library (including all -DOMIT_* defines)? --- Mark Brown [EMAIL PROTECTED] wrote: Thanks for the quick reply. Unfortunately, we are developing code on the vxWorks platform, so I don't think sample code would be of use. We have

Re: [sqlite] Multiple connections - stale cache?

2007-06-26 Thread drh
Mark Brown [EMAIL PROTECTED] wrote: Thanks for the quick reply. Unfortunately, we are developing code on the vxWorks platform, so I don't think sample code would be of use. We have seen the problem for some time now...at least from 3.3.12. The logic in SQLite that handles cache

Re: [sqlite] [Delphi] Escaping quote?

2007-06-26 Thread John Elrick
Clay Dowling wrote: John Elrick wrote: // Input := 'Let's meet at the pub tonight!'; MyFormat := 'insert into stuff (title) values (%s)'; SQL := Format(MyFormat, QuotedStr(Input)); try ASQLite3DB1.Database := db; ASQLite3DB1.DefaultDir := ExtractFileDir(Application.ExeName);

Re: [sqlite] [Delphi] Escaping quote?

2007-06-26 Thread Clay Dowling
John Elrick wrote: A much better solution than QuotedStr is to use queries with parameters. If you're going to be running the query multiple times it also gives you a speed boost. True, however, that assumes you will be running the query multiple times in a row, which I haven't

RE: [sqlite] Multiple connections - stale cache?

2007-06-26 Thread Mark Brown
Hi Richard and Joe- It probably is some application error in our code. What puzzles me is that calling sqlite3_enable_shared_cache(1) appears to fix (or at least change) the behavior. Not sure if that triggers any ideas as to what our problem might be. Your suggestion of looking at the

Re: [sqlite] [Delphi] Escaping quote?

2007-06-26 Thread drh
Clay Dowling [EMAIL PROTECTED] wrote: John Elrick wrote: A much better solution than QuotedStr is to use queries with parameters. If you're going to be running the query multiple times it also gives you a speed boost. True, however, that assumes you will be running the query

[sqlite] cache_size documentation vs. page_size setting

2007-06-26 Thread Andrew Finkenstadt
In the documentation for cache_size, the description for how much memory a page takes up says Each page uses about 1.5K of memory.. I believe that it is more accurate to say that Each page uses the database page_size plus about 512 bytes. I don't know how best to phrase it, save as a series of

[sqlite] thread concurrency, inserts using transactions, bug?

2007-06-26 Thread Brad House
I've read http://www.sqlite.org/cvstrac/wiki?p=MultiThreading under the Case in point: a benchmark application I've written for this purpose and found that current releases of SQLite do not appear to behave in this manner. I cannot find any documentation which clearly states the intended

Re: [sqlite] thread concurrency, inserts using transactions, bug?

2007-06-26 Thread Ken
Brad, Here are my results after modifying the begin transaction to a begin exclusive Begin transaction is a bit Lazy in that the lock escalation doesnt occur until the pager escalates the lock due to a write. You'll see that the begin exclusive acquires a lock immediately and avoids the

Re: [sqlite] thread concurrency, inserts using transactions, bug?

2007-06-26 Thread drh
Brad House [EMAIL PROTECTED] wrote: I've read http://www.sqlite.org/cvstrac/wiki?p=MultiThreading under the Case in point: a benchmark application I've written for this purpose and found that current releases of SQLite do not appear to behave in this manner. I cannot find any documentation

Re: [sqlite] thread concurrency, inserts using transactions, bug?

2007-06-26 Thread Brad House
Here are my results after modifying the begin transaction to a begin exclusive Begin transaction is a bit Lazy in that the lock escalation doesnt occur until the pager escalates the lock due to a write. You'll see that the begin exclusive acquires a lock immediately and avoids the

Re: [sqlite] Tomcat crashes with SQLite

2007-06-26 Thread Frederic de la Goublaye
I am just trying the last version of http://www.ch-werner.de/javasqlite/ date: June 26th 2007 Lucy will see if she is ok now... http://lucy.ysalaya.org Cheers Frederic de la Goublaye On 6/25/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Frederic de la Goublaye [EMAIL PROTECTED] wrote: My

Re: [sqlite] thread concurrency, inserts using transactions, bug?

2007-06-26 Thread Brad House
[EMAIL PROTECTED] wrote: It appears that if 2 threads start transactions at the same time, both inserting into the same table, neither thread can finish until one has rolled back. The behavior is deliberate because it gives you, the programmer, more control and better concurrency in some

Re: [sqlite] thread concurrency, inserts using transactions, bug?

2007-06-26 Thread Ken
Brad, its my understanding that Locking occurs at the Database level, not the table level. http://www.sqlite.org/lockingv3.html Brad House [EMAIL PROTECTED] wrote: Here are my results after modifying the begin transaction to a begin exclusive Begin transaction is a bit Lazy in that

RE: [sqlite] Multiple connections - stale cache?

2007-06-26 Thread Mark Brown
I have some odd results to report on the db counter. I put some diagnostic code in our database wrapper class to write out the db counter whenever a statement is executed. It will print out for every statement executed whether the statement is a SELECT or UPDATE or BEGIN TRANSACTION. Richard

[sqlite] colname=22 vs colname='22'

2007-06-26 Thread jose isaias cabrera
Greetings. I have the following db declarations: SQLite version 3.3.8 Enter .help for instructions sqlite .schema CREATE TABLE LSOpenJobs ( id integer primary key, ProjID integer, subProjID, parent, children, login, cust, proj, PClass, PSubClass, bdate, ddate, edate, pm, pmuk,

Re: [sqlite] Multiple connections - stale cache?

2007-06-26 Thread drh
Mark Brown [EMAIL PROTECTED] wrote: REPEAT TEST 1 - DB Counter 0:0:42:-89 DB Counter 0:0:42:-89 DB Counter 0:0:42:-89 DB Counter 0:0:42:-89 DB Counter 0:0:42:-96 -- What did my code do to cause this? This is going to be

Re: [sqlite] Crashes and random wrong results with certain column names

2007-06-26 Thread Dennis Cote
Yves Goergen wrote: Hi, I've tested my own SQLite application's identifier quoting capabilities now and found that the SQLite engine has serious problems with table/column names containing certain special characters. Just try the following: CREATE TABLE t a (c a, cb); INSERT INTO t a (c a, cb)

Re: [sqlite] Crashes and random wrong results with certain column names

2007-06-26 Thread drh
Dennis Cote [EMAIL PROTECTED] wrote: Yves Goergen wrote: Hi, I've tested my own SQLite application's identifier quoting capabilities now and found that the SQLite engine has serious problems with table/column names containing certain special characters. Just try the following:

Re: [sqlite] Crashes and random wrong results with certain column names

2007-06-26 Thread Dennis Cote
[EMAIL PROTECTED] wrote: You should file a bug ticket at http://www.sqlite.org/cvstrac/captcha?nxp=/cvstrac/tktnew since these are all valid quoted SQL identifiers. http://www.sqlite.org/cvstrac/tktview?tn=2450 I see I'm late to the party again. :-) I'm glad to see this was

Re: [sqlite] Introducing... ManagedSQLite

2007-06-26 Thread Yves Goergen
On 26.06.2007 00:24 CE(S)T, WHITE, DANIEL wrote: The main advantage of mine is that it is lightweight and easy to use without using ADO.NET. Okay, the other SQLite.NET DLL has 592 kB, that's not necessarily lightweight. I'd like to be able to include the SQLite library into the main assembly so

Re: [sqlite] Crashes and random wrong results with certain column names

2007-06-26 Thread Yves Goergen
On 27.06.2007 01:35 CE(S)T, [EMAIL PROTECTED] wrote: http://www.sqlite.org/cvstrac/tktview?tn=2450 Wow, I guess from that page that it's already fixed? One question regarding the issue tracker: Is there a reference of what the severity and priority values mean? Is a lower value more or less

Re: [sqlite] Crashes and random wrong results with certain column names

2007-06-26 Thread drh
Yves Goergen [EMAIL PROTECTED] wrote: On 27.06.2007 01:35 CE(S)T, [EMAIL PROTECTED] wrote: http://www.sqlite.org/cvstrac/tktview?tn=2450 Wow, I guess from that page that it's already fixed? One question regarding the issue tracker: Is there a reference of what the severity and priority

RE: [sqlite] Introducing... ManagedSQLite

2007-06-26 Thread Robert Simpson
-Original Message- From: Yves Goergen [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 26, 2007 4:55 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Introducing... ManagedSQLite On 26.06.2007 00:24 CE(S)T, WHITE, DANIEL wrote: The main advantage of mine is that it is

Re: [sqlite] SQLite Project. A contribution to manking

2007-06-26 Thread drh
Cesar D. Rodas [EMAIL PROTECTED] wrote: I was surfing and I saw that sqlite website is very busy with a hight band width traffic (http://alexa.com/data/details/traffic_details?url=sqlite.org) and I was reading about the SQLite has an Server which is not the normal apache or other known

Re: [sqlite] colname=22 vs colname='22'

2007-06-26 Thread Dan Kennedy
On Tue, 2007-06-26 at 17:50 -0400, jose isaias cabrera wrote: Greetings. I have the following db declarations: SQLite version 3.3.8 Enter .help for instructions sqlite .schema CREATE TABLE LSOpenJobs ( id integer primary key, ProjID integer, subProjID, parent,