[sqlite] SQLite NFS Problem compared to Other Db's

2006-07-21 Thread Ritesh Kapoor
Hi, Most of us are aware that SQLite on Linux has problems with NFS mounted volumes - basically the file locking issue. If there is a single thread accessing the SQLite DB - and this is guaranteed - then there is no need to have file locking. So I modified the code for SQLite and removed all loc

RE: [sqlite] SQLiteSpy vs. SQLite.dll speed comparison

2006-07-21 Thread Shields, Daniel
> Daniel: > Thanks for the suggestion. > I wasn't aware that the prepare statement gained you that > much for one-table select queries. > I use it for multi-100k inserts (along with trans.) and it > saves quite a bit of time. > This is my sql for the present problem: > > select * from (select

Re: [sqlite] How to calculate the sum up to a row better than O(n^2)?

2006-07-21 Thread jt
Store the sum instead of the amount, then if you need the amount just use this amount(0) = sum(0) amount(t_i) = sum(t_i) - sum(t_(i-1)) This way, if you need to select all amount it only takes O(n). Insert/delete/update takes longer but you select more often than youi insert/delete/update. On 7/

[sqlite] import in sqlite

2006-07-21 Thread sandhya
Hi, Is there any possibility to import files from the local file system and storing in sqlite DB.And Is there any export option just to check whether the loaded file into a table consists of same data as the original file or not. Is it possible in sqlite? If possible,How it will stores fil

RE: [sqlite] SQLiteSpy vs. SQLite.dll speed comparison

2006-07-21 Thread Christian Smith
michael cuthbertson uttered: Brannon: Thank you for your thoughts. To be clear, the 'optimize for speed' setting in MY release is actually slower than MY debug version - I know nothing about Ralf's settings. That issue is separate from SQLiteSpy - I didn't mean to conflate them. And the issue i

Re: [sqlite] How to port the SQLite

2006-07-21 Thread Christian Smith
You're better off posting this to the list, as I can't answer specifics for lack of experience of VxWorks. I'll answer what I can inline... Vivek R uttered: Hi Smith, I have the following doubt in SQLite. Could you please help me regarding theese... 1. what are the resources required by S

Re: [sqlite] Help me in SQL

2006-07-21 Thread Jay Sprenkle
Can you change the alias to a different field name than the source tables? On 7/20/06, blins <[EMAIL PROTECTED]> wrote: Hi sqlite-users@sqlite.org, I use sqliteODBC 0.68 + ADO and SQLite 3.3.6. I try executing sql: select t1.field1 as field1, t2.field2 as field2 from table1 t1 left join tabl

Re: [sqlite] SQLite NFS Problem compared to Other Db's

2006-07-21 Thread Jay Sprenkle
On 7/21/06, Ritesh Kapoor <[EMAIL PROTECTED]> wrote: I've also removed the Synch-mechanism and increased the SQLite page size as well as the number of pages to hold in cache. I understand that all this can cause data loss if the system crashes but that is tolerable. What I can't figure out is

[sqlite] Using prepare, step, finalize and hadling BUSY answers

2006-07-21 Thread Daniel van Ham Colchete
Hello everyone, I'm new on this list and I have only a few months of experience with SQLITE. I use SQLITE 3.3.6 for Linux with C++. I'm having a few problems with locking. But before describing the problem itself, I would like to check if I'm doing something wrong. That's what I do when I try to

Re: [sqlite] SQLite NFS Problem compared to Other Db's

2006-07-21 Thread John Stanton
Over NFS you are limited to the bandwidth of your network, probably 1-10 Mb/s. Compare that to the disk speed on your host server, one or two orders of magnitude better. The NFS link could be up to 50 times slower. If you want better distributed performance use a DBMS server like PostgreSQL.

Re: [sqlite] Using prepare, step, finalize and hadling BUSY answers

2006-07-21 Thread Jay Sprenkle
On 7/21/06, Daniel van Ham Colchete <[EMAIL PROTECTED]> wrote: I'm having problems understanding the SQLite docs. At the 'C/C++ Interface for SQLite Version 3' it says that sqlite3_exec is a wrapper to 'prepare, finalize, reset' without a step. But a little bit down the document it says you shou

Re: [sqlite] SQLiteSpy vs. SQLite.dll speed comparison

2006-07-21 Thread John Stanton
It is possible to resolve the issue by using the traditional C profiler. Compile the SQL library with profiling on the different compilers and measure where the time is spent during execution. You can also compile some test programs and look at the assembler output to get an idea of the effic

Re: [sqlite] Using prepare, step, finalize and handling BUSY answers

2006-07-21 Thread Daniel van Ham Colchete
Jay Sprenkle wrote: > Here's some example code: > > sqlite3*db; > > // connect to database > if ( sqlite3_open( "test.db", &db ) ) > throw "Can't open database"; > > char* sql; > > // two forms of the same sql > sql = "SELECT one.test1, two.test2" > " FROM one" > " INNER JOIN tw

Re: [sqlite] Using prepare, step, finalize and handling BUSY answers

2006-07-21 Thread Jay Sprenkle
Jay, thank you very much man! That answers a lot. And it showed me that I was not checking the SQLITE_LOCKED case. But, from what I can see, if your database is busy or locked you just stop your program execution, or you will end this function WITHOUT running neither sqlite3_finalize nor sqlite3_

[sqlite] SQLiteSpy - new topic

2006-07-21 Thread Hartwig Wiesmann
Hello, is there a similar program as SQLiteSpy for other platforms available? I am especially interested in programs running on MacOS X. Hartwig

[sqlite] A littel question...

2006-07-21 Thread Cesar David Rodas Maldonado
Hello to everybody If I have a table with 100.000 unique words I am wondering if SQLite select if faster an cheaper (RAM, Processor, etc), or If i have to help SQLite using a Hash function, and what could be that Hash function? Thanks.

Re: [sqlite] A littel question...

2006-07-21 Thread Clay Dowling
Cesar David Rodas Maldonado said: > Hello to everybody > > If I have a table with 100.000 unique words I am wondering if SQLite > select > if faster an cheaper (RAM, Processor, etc), or If i have to help SQLite > using a Hash function, and what could be that Hash function? If you're going to the

Re: [sqlite] A littel question...

2006-07-21 Thread John Stanton
Cesar David Rodas Maldonado wrote: Hello to everybody If I have a table with 100.000 unique words I am wondering if SQLite select if faster an cheaper (RAM, Processor, etc), or If i have to help SQLite using a Hash function, and what could be that Hash function? Thanks. Do you want to selec

Re: [sqlite] Using prepare, step, finalize and handling BUSY answers

2006-07-21 Thread Daniel van Ham Colchete
Jay Sprenkle wrote: >> Jay, thank you very much man! That answers a lot. And it showed me that >> I was not checking the SQLITE_LOCKED case. >> >> But, from what I can see, if your database is busy or locked you just >> stop your program execution, or you will end this function WITHOUT >> running n

Re: [sqlite] A littel question...

2006-07-21 Thread Daniel van Ham Colchete
Cesar David Rodas Maldonado wrote: > Hello to everybody > > If I have a table with 100.000 unique words I am wondering if SQLite > select > if faster an cheaper (RAM, Processor, etc), or If i have to help SQLite > using a Hash function, and what could be that Hash function? > > Thanks. > Cesar, y

Re: [sqlite] A littel question...

2006-07-21 Thread Cesar David Rodas Maldonado
I have not a substring, I have a list of words (stemmed words of several languages) and i just want to get the Id. The word is unique

Re: [sqlite] A littel question...

2006-07-21 Thread Cesar David Rodas Maldonado
I know that, but I would like to know if will be better first transform the word into a number (a hash function), after that select the number and after search with the index of the word... understand?. I am sorry for my english... On 7/21/06, Daniel van Ham Colchete <[EMAIL PROTECTED]> wrote:

Re: [sqlite] Using prepare, step, finalize and handling BUSY answers

2006-07-21 Thread Jay Sprenkle
> That's what I think as well. But, when you say 'all your suggestions' are you talking about sqlite3_interrupt too? That would be useful if you were doing queries where you don't know how long they will take. All my code is written in a way the queries are short so I would not have to abort lon

Re: [sqlite] A littel question...

2006-07-21 Thread John Stanton
If I were looking up a table with only 100,000 words and wanted it to be fast - CASE OF SEARCHING ON WORD a. If it is a fixed table. Sort into alpha sequence in a flat file, open and memory map the file and use a binary search. Very simple and fast and would find your word in a few microseco

Re: [sqlite] A littel question...

2006-07-21 Thread John Stanton
Cesar David Rodas Maldonado wrote: I have not a substring, I have a list of words (stemmed words of several languages) and i just want to get the Id. The word is unique In that case the sqlite B-Tree index is about as good as you will get. just make sure that the word is an index.

Re: [sqlite] A littel question...

2006-07-21 Thread Daniel van Ham Colchete
Cesar, in that case Clay Dowling's answer says it all: it's faster to use an hash as an index preloading all your data into your RAM memory (without SQLite), but if you don't want to use that amount of memory then you could use an INDEX that will create a Binary Tree (=btree) that will make your s

Re: [sqlite] A littel question...

2006-07-21 Thread Cesar David Rodas Maldonado
Thanks very much to all of you! I am doing a project of fulltext with sqlite, and i will share the code when a i finish... thanks to all for your help. On 7/21/06, John Stanton <[EMAIL PROTECTED]> wrote: Cesar David Rodas Maldonado wrote: > I have not a substring, I have a list of words (stem

[sqlite] Temp dir

2006-07-21 Thread chtaylo3
I have a question about os_unix.c On line 854 inside function sqlite3UnixTempFileName, you declare: static const char *azDirs[] = { 0, "/var/tmp", "/usr/tmp", "/tmp", ".", }; I'm guessing this is where sqlite attempts to create a temp copy of the database it's opening.

Re: [sqlite] Temp dir

2006-07-21 Thread drh
chtaylo3 <[EMAIL PROTECTED]> wrote: > I have a question about os_unix.c > > On line 854 inside function sqlite3UnixTempFileName, you declare: > static const char *azDirs[] = { > 0, > "/var/tmp", > "/usr/tmp", > "/tmp", > ".", > }; > > I'm guessing this is where sqlite a

RE: [sqlite] Temp dir

2006-07-21 Thread chtaylo3
>Set the global variable sqlite3_temp_directory to any >directory you want and it tries that directory first. Ok, fair enough. But why do you try and open the directory? Why can you just try and create the tmp file there and deal with it if it's not allowed? I'm asking becuase I have permissi

[sqlite] Retrieving ROWID value on duplicate conflict

2006-07-21 Thread Naveen Nathan
Hi Folks, i I'm unsure if SQLite provides the functionality I seek. On a duplicate entry/conflict I would like to retrieve the rowid of the conflicting entry; by possibly updating columns, or replacing the row entirely while ensuring the rowid doesn't change. On an INSERT OR REPLACE it deletes th

RE: [sqlite] SQLiteSpy vs. SQLite.dll speed comparison

2006-07-21 Thread michael cuthbertson
Thanks to Christian and John for the pointers regarding compilers. I have not compiled the sqlite sources myself but have used the supplied binary. Could either one you give me some tips for compiling the sqlite sources for either vs 6 or 8? John, I will follow your advice on inline functions. The

Re: [sqlite] SQLiteSpy vs. SQLite.dll speed comparison

2006-07-21 Thread John Stanton
Michael, The guy who produced Sqlitespy is a member of this forum so he can confirm or debunk my theory as to why you are getting a big difference in execution time. I suspect that Sqlitespy might be storing the SQL in its compiled (from sqlite3_prepare) form and when you run it you skip the

[sqlite] help with win32/iis install

2006-07-21 Thread greenshire
Greetings. I recently installed php 5 on Win 2k3 server (iis 6). I enabled the pdo and sqlite extensions for sqlite, but using the test script from http://www.tanguay.at/installPhp5.php5?step=8 , I get error message: "failed to open/create the database." Any ideas? Thank you, -- greenshire