Re: [sqlite] How to set memory usage as high as possible -- but not too high?

2008-04-14 Thread Ralf Junker
Roger Binns wrote: >Are you using a 32 bit or 64 bit process. 32, but it does not matter to the problem. >Also is there a requirement to create the database in the filesystem? Yes. >If not you could ensure your swap is sufficiently large (I use a mininmum of >16GB on my machines :-) and

Re: [sqlite] How to set memory usage as high as possible -- but not too high?

2008-04-14 Thread Ralf Junker
Dan, many thanks for the quick response and detailed answers. However, a question or two still puzzle me. >> * OPTION 1: PRAGMA cache_size = 1000; >> >> Advantage: SQLite will use ample memory, but no more than that. >> >> Disadvantage: Difficulty to establish exact memory requirements in

[sqlite] How to manage separate lists of ordered items?

2008-04-14 Thread skillzero
If I have something like a real estate database where each customer can have an ordered list of houses they want to visit, is there a recommended way to design tables that just link to other tables to create the ordered list? I have a table of houses and a table of customers. My (probably

Re: [sqlite] How to manage separate lists of ordered items?

2008-04-14 Thread Paul Smith
[EMAIL PROTECTED] wrote: > If I have something like a real estate database where each customer > can have an ordered list of houses they want to visit, is there a > recommended way to design tables that just link to other tables to > create the ordered list? I have a table of houses and a table of

[sqlite] Populating and scrolling the Listbox using query

2008-04-14 Thread Farzana
Dear All, We are working in eVC++ environment with SQLite database.We need to populate the listbox with the values obtained by executing the query. We were able to get the values of the query by using the API’s sqlite3_prepare and sqlite3_step. But we were able to populate and move the listbox

Re: [sqlite] Populating and scrolling the Listbox using query

2008-04-14 Thread Igor Tandetnik
"Farzana" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > We are working in eVC++ environment with SQLite database.We need to > populate the listbox with the values obtained by executing the query. > We were able to get the values of the query by using the API's > sqlite3_prepare and

Re: [sqlite] SQL Quick Review/Reference

2008-04-14 Thread Mike Owens
On Sat, Apr 12, 2008 at 9:36 AM, Rich Shepard <[EMAIL PROTECTED]> wrote: > On Fri, 11 Apr 2008, Amit Uttamchandani wrote: >I second the recommendation of Mike Owens' "The Definitive Guide to > SQLite" for detailed insight on this system. And it does have the worst > index of any technical

Re: [sqlite] SQL Quick Review/Reference

2008-04-14 Thread ajm
Mike: As a purchaser of your Book, I think that perhaps you can have a copy of the book in plain text form. Then, with a little effort can be made a index of words, and (also) perhaps it would be easier that Apress let you publish it. In respect to the index creation I would help in that.

Re: [sqlite] SQL Quick Review/Reference

2008-04-14 Thread Rich Shepard
On Mon, 14 Apr 2008, Mike Owens wrote: > I know I've said this before, but I just want to say it again because it > pains me that the index is so bad: I had absolutely nothing to do with the > index. While I was presented with the index to look over, I only had about > a day to provide any

Re: [sqlite] SQL Quick Review/Reference

2008-04-14 Thread Martin Jenkins
Mike Owens wrote: > I've been lobbying Apress to release the book in electronic form for > free. It's currently under consideration, but I've not heard anything > back yet. > That seems a bit extreme - how about a user generated/funded index on the web somewhere? Download and print a PDF,

Re: [sqlite] Populating and scrolling the Listbox using query

2008-04-14 Thread Fred Williams
Might want to download the free source for the Delphi VCL set for Sqlite DB access componenets provided at Aducom.com and review the releven source code. Sorry, it is written that highly "inelegant" Object Pascal. But I'm an old "C" coder from way back and do read and write Object Pascal more so

Re: [sqlite] segmentation fault

2008-04-14 Thread Glenn McAllister
dark0s dark0s wrote: > I did not used never gdb. > Can I post me commands that I must to use OK, you are seriously becoming a help vampire (http://www.slash7.com/pages/vampires) at this point. Here are some pointers: - Programming in C: A Modern Approach

[sqlite] Implicit INDEX?

2008-04-14 Thread Chris Tracy
Hello, I'm a relative newcommer to SQL and SQLite and have was is likely a silly question. However, I've not found an answer to it or even a reference to anything similar in searching the list archives or the web. If I have a table laid out thusly: CREATE TABLE bridge_table (

Re: [sqlite] How to set memory usage as high as possible -- but not too high?

2008-04-14 Thread Jay A. Kreibich
On Mon, Apr 14, 2008 at 09:51:40AM +0200, Ralf Junker scratched on the wall: > >> * OPTION 1: PRAGMA cache_size = 1000; > >> > >> Advantage: SQLite will use ample memory, but no more than that. > >> > >> Disadvantage: Difficulty to establish exact memory requirements in > >> advance. The

[sqlite] want to purchase

2008-04-14 Thread Arvind M
dear sir i want to purchase of sqlite server kinly give me guidance arvind systime ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Transaction across threads

2008-04-14 Thread Shailesh Birari
Hello, I had a doubt of sqlite transactions across threads. I have a multithreaded application which shares the same sqlite connection across threads. I had a few doubts 1) If I do a begin transaction and insert on one thread. Then do a insert on the second thread and finally a commit on the

Re: [sqlite] Implicit INDEX?

2008-04-14 Thread P Kishor
On 4/14/08, Chris Tracy <[EMAIL PROTECTED]> wrote: > Hello, > > I'm a relative newcommer to SQL and SQLite and have was is likely > a silly question. However, I've not found an answer to it or even a > reference to anything similar in searching the list archives or the web. > >

Re: [sqlite] Implicit INDEX?

2008-04-14 Thread Chris Tracy
>> inserted into the database in ascending order, and where there may be as >> many as 500 hID entries for each timestamp. After a while, this table > Have you considered making timestamp a PRIMARY KEY? > > So, declare it as INTEGER PRIMARY KEY NOT NULL Unfortunately, the timestamps

Re: [sqlite] Implicit INDEX?

2008-04-14 Thread Chris Tracy
Err, Make that example table data: <...> 1167611400|89|7|34 1167611400|101|5|4 1167611400|147|9|14 1167611400|173|7|2 1167611400|195|8|1 1167611400|314|8|12 1167611400|347|6|48 1167611400|364|1|49 1167615600|111|7|39 1167615600|155|2|8 1167615600|157|4|7 1167615600|220|4|47

Re: [sqlite] Implicit INDEX?

2008-04-14 Thread P Kishor
On 4/14/08, Chris Tracy <[EMAIL PROTECTED]> wrote: > Err, > > Make that example table data: > > <...> > > 1167611400|89|7|34 > 1167611400|101|5|4 > 1167611400|147|9|14 > 1167611400|173|7|2 > 1167611400|195|8|1 > 1167611400|314|8|12 > 1167611400|347|6|48 > 1167611400|364|1|49 > > >

Re: [sqlite] SQLITE_LOCKED behavior

2008-04-14 Thread Shawn Wilsher
> Are you using a shared cache? You can get also get SQLITE_LOCKED when > using a shared cache. See section 2.2 of > . > > I've not used a shared cache myself. One day I was wondering if I > needed to worry about handling SQLITE_LOCKED errors and I

Re: [sqlite] Implicit INDEX?

2008-04-14 Thread Chris Tracy
> Your first sentence above is that you "almost immediately get back all > the results you want" then you go on to say that the "actual SELECT > doesn't return for almost 13 additional seconds." So, what is it > exactly that you "almost immediately get back"? When I run the select inside

Re: [sqlite] Implicit INDEX?

2008-04-14 Thread P Kishor
On 4/14/08, Chris Tracy <[EMAIL PROTECTED]> wrote: > > Your first sentence above is that you "almost immediately get back all > > the results you want" then you go on to say that the "actual SELECT > > doesn't return for almost 13 additional seconds." So, what is it > > exactly that you "almost

Re: [sqlite] Implicit INDEX?

2008-04-14 Thread Chris Tracy
> a shot in the dark. Try > > SELECT * from bridge_table WHERE timestamp < 1167615601; > > although, it would probably not help because SQLite would still have > to scan the table to ascertain there were no more rows that met the > criterion. My hunch is that without giving the program some hint

Re: [sqlite] Implicit INDEX?

2008-04-14 Thread Griggs, Donald
Hi, Chris, Regarding: "It seems to me (and I might be wrong) that since the values are already in the database in ascending order by timestamp that SQLite is able to find all the results quite quickly. ..." To test this, I think you'd want to create a select for some of the most recent data

Re: [sqlite] SQL Quick Review/Reference

2008-04-14 Thread Mike Owens
On Mon, Apr 14, 2008 at 8:45 AM, Martin Jenkins <[EMAIL PROTECTED]> wrote: > Mike Owens wrote: > > I've been lobbying Apress to release the book in electronic form for > > free. It's currently under consideration, but I've not heard anything > > back yet. > > > That seems a bit extreme - how

Re: [sqlite] Implicit INDEX?

2008-04-14 Thread Jay A. Kreibich
On Mon, Apr 14, 2008 at 10:06:27AM -0700, Chris Tracy scratched on the wall: > > Your first sentence above is that you "almost immediately get back all > > the results you want" then you go on to say that the "actual SELECT > > doesn't return for almost 13 additional seconds." So, what is it > >

Re: [sqlite] Implicit INDEX?

2008-04-14 Thread Chris Tracy
> If you need to do this from the shell, I'm not sure there is anything > you can do. If you're doing this from the C API just look for timestamps > that are >= your target and terminate the query as soon as you find one > larger than the target timestamp (e.g. stop calling step() and call >

Re: [sqlite] Implicit INDEX?

2008-04-14 Thread Chris Tracy
Donald, > To test this, I think you'd want to create a select for some of the most > recent data (i.e. data at the tail of the database), perhaps after > clearing cache. I suspect this will take the full table scan time to > return any values. I'd actually just thought of that. All my

Re: [sqlite] Implicit INDEX?

2008-04-14 Thread David Bicking
Can you create a second table holding the minimum rowid and maximum rowid from your main data table. You query this table, get the range or rowid, then you can query the main table WHERE rowid >= MinRowid AND rowid <= MaxRowid. That would than use the built in primary index. David --- On

Re: [sqlite] Implicit INDEX?

2008-04-14 Thread P Kishor
On 4/14/08, Chris Tracy <[EMAIL PROTECTED]> wrote: > > If you need to do this from the shell, I'm not sure there is anything > > you can do. If you're doing this from the C API just look for timestamps > > that are >= your target and terminate the query as soon as you find one > > larger

Re: [sqlite] want to purchase

2008-04-14 Thread Rich Shepard
On Mon, 14 Apr 2008, Arvind M wrote: > i want to purchase of sqlite server kinly give me guidance It comes bundled with a bridge in New York City. But, if you don't want the bridge, just download the software and use it. Read the license, ask questions on what you don't understand. --

[sqlite] Looking for a consultant to write a mysql extended function

2008-04-14 Thread Dewey Gaedcke
If you are interested, please email directly to [EMAIL PROTECTED] Please don't cc the list Regards, Dewey No virus found in this outgoing message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.22.13/1377 - Release Date: 4/14/2008 9:26 AM

Re: [sqlite] Implicit INDEX?

2008-04-14 Thread Jeffrey Rennie
On Mon, Apr 14, 2008 at 9:48 AM, Chris Tracy <[EMAIL PROTECTED]> wrote: > >> inserted into the database in ascending order, and where there may be > as > >> many as 500 hID entries for each timestamp. After a while, this table > > > Have you considered making timestamp a PRIMARY KEY? > > > >

[sqlite] Connection Sharing across threads

2008-04-14 Thread Shailesh Birari
In one of the wiki entries, http://www.sqlite.org/cvstrac/wiki?p=MultiThreading , I read that application cannot share the sqlite connection across threads. However in another posting at http://www.sqlite.org/sharedcache.html

Re: [sqlite] SQLITE_LOCKED behavior

2008-04-14 Thread D . Richard Hipp
On Apr 14, 2008, at 12:57 PM, Shawn Wilsher wrote: >> Are you using a shared cache? You can get also get SQLITE_LOCKED >> when >> using a shared cache. See section 2.2 of >> . >> >> I've not used a shared cache myself. One day I was wondering if I >>

Re: [sqlite] Implicit INDEX?

2008-04-14 Thread Dennis Cote
Jeffrey Rennie wrote: > On Mon, Apr 14, 2008 at 9:48 AM, Chris Tracy <[EMAIL PROTECTED]> wrote: > inserted into the database in ascending order, and where there may be >> as many as 500 hID entries for each timestamp. After a while, this table >>> Have you considered making timestamp

Re: [sqlite] Implicit INDEX?

2008-04-14 Thread P Kishor
On 4/14/08, Dennis Cote <[EMAIL PROTECTED]> wrote: > Jeffrey Rennie wrote: > > On Mon, Apr 14, 2008 at 9:48 AM, Chris Tracy <[EMAIL PROTECTED]> wrote: > > > inserted into the database in ascending order, and where there may be > >> as > many as 500 hID entries for each timestamp.

Re: [sqlite] Implicit INDEX?

2008-04-14 Thread Ken
Does sqlite have support for index based tables as a storage means? This is an excelent case for index based storage. just my .02 Ken Dennis Cote <[EMAIL PROTECTED]> wrote: Jeffrey Rennie wrote: > On Mon, Apr 14, 2008 at 9:48 AM, Chris Tracy wrote: > inserted into the database in

Re: [sqlite] Looking for a consultant to write a sqlite (not mysql-->typo) extended function

2008-04-14 Thread Dewey Gaedcke
Very sorry for the typo-we need a sqlite extentionNOT mysql Subject: Looking for a consultant to write a mysql extended function If you are interested, please email directly to [EMAIL PROTECTED] Please don't cc the list Regards, Dewey No virus found in this outgoing message. Checked

Re: [sqlite] SQLITE_LOCKED behavior

2008-04-14 Thread Shawn Wilsher
> I am not aware of any reason why you cannot retry an SQLITE_LOCKED > error after a delay, however. Have you actually tried doing that? > Is it giving you trouble? Attempting to retry after it being issues results in SQLITE_MISUSE being returned. Cheers, Shawn

Re: [sqlite] SQLITE_LOCKED behavior

2008-04-14 Thread D. Richard Hipp
On Apr 14, 2008, at 2:44 PM, Shawn Wilsher wrote: >> I am not aware of any reason why you cannot retry an SQLITE_LOCKED >> error after a delay, however. Have you actually tried doing that? >> Is it giving you trouble? > Attempting to retry after it being issues results in SQLITE_MISUSE > being

Re: [sqlite] Table modifications and analyze

2008-04-14 Thread D. Richard Hipp
On Apr 14, 2008, at 2:49 PM, Petite Abeille wrote: > Hello, > > What heuristics do people use to determine the frequency for analyzing > their indices? > I use the simple heuristic of never running ANALYZE. The ANALYZE command is only helpful to the optimizer in certain extreme cases. See,

[sqlite] Table modifications and analyze

2008-04-14 Thread Petite Abeille
Hello, What heuristics do people use to determine the frequency for analyzing their indices? Is there something equivalent to user_tab_modifications that keep tracks of the number of inserts, updates and deletes for each table? Thanks in advance. Kind regards, -- PA.

Re: [sqlite] SQLITE_LOCKED behavior

2008-04-14 Thread Shawn Wilsher
> Did you call sqlite3_reset() before each retry? Ah, I didn't realize I'd have to do that. When I get SQLITE_BUSY returned, I can just retry it, so I made the wrong assumption that that would work in this case as well. Cheers, Shawn ___ sqlite-users

Re: [sqlite] Implicit INDEX?

2008-04-14 Thread RB Smissaert
Have tested this now on a table of some 30 rows (no indexes at all) and with 100 rows to find in the middle of the table, sorted asc on time-stamp field. It gave me a speed increase of about 25%. If I looked for rows at the beginning of the table the speed increase was more, some 50% faster.

Re: [sqlite] Implicit INDEX?

2008-04-14 Thread John Stanton
You can make the timestamps unique by appending a sequence number. A 32 bit Unix timestamp can map into a 64 bit Sqlite integer. P Kishor wrote: > On 4/14/08, Chris Tracy <[EMAIL PROTECTED]> wrote: >> Err, >> >> Make that example table data: >> >> <...> >> >> 1167611400|89|7|34 >>

[sqlite] SQLite>=3.5.6 does not open database file

2008-04-14 Thread Steve Topov
I already reported this bug but did not receive any responds so I am trying one more time. The problem: SQLite version 3.5.6 and up returns an error when opening some database files. The error is “SQL logic error or missing database”. Version prior to version 3.5.6 works fine with these database

Re: [sqlite] SQLite>=3.5.6 does not open database file

2008-04-14 Thread Michael Ruck
Is there a previous version, which is able to open this database file? Which version of SQLite was the database file created with? -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Steve Topov Gesendet: Montag, 14. April 2008 22:31 An:

Re: [sqlite] SQLite>=3.5.6 does not open database file

2008-04-14 Thread P Kishor
On 4/14/08, Steve Topov <[EMAIL PROTECTED]> wrote: > I already reported this bug but did not receive any responds so I am > trying one more time. > The problem: > SQLite version 3.5.6 and up returns an error when opening some database > files. The error is "SQL logic error or missing

Re: [sqlite] SQLite>=3.5.6 does not open database file

2008-04-14 Thread Steve Topov
I can open this file with version 3.3.5. I do not know the version this file was created with but I can guess it was some earliest versions of SQLite 3. File created with version 3.3.5 works fine with version 3.5.6. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On

Re: [sqlite] SQLite>=3.5.6 does not open database file

2008-04-14 Thread Steve Topov
I can open the file with 3.3.5. I did not try to dump it and recreate with 3.5.6. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of P Kishor Sent: Monday, April 14, 2008 1:38 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLite>=3.5.6

Re: [sqlite] SQLite>=3.5.6 does not open database file

2008-04-14 Thread Dennis Cote
Steve Topov wrote: > I already reported this bug but did not receive any responds so I am > trying one more time. > The problem: > SQLite version 3.5.6 and up returns an error when opening some database > files. The error is “SQL logic error or missing database”. > Version prior to version 3.5.6

Re: [sqlite] SQLite>=3.5.6 does not open database file

2008-04-14 Thread P Kishor
On 4/14/08, Steve Topov <[EMAIL PROTECTED]> wrote: > I can open the file with 3.3.5. I did not try to dump it and recreate > with 3.5.6. > well then. Do it and see if it works. > > -Original Message- > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of P Kishor >

Re: [sqlite] SQLite>=3.5.6 does not open database file

2008-04-14 Thread D. Richard Hipp
On Apr 14, 2008, at 4:53 PM, D. Richard Hipp wrote: > > On Apr 14, 2008, at 4:47 PM, Steve Topov wrote: >> I can open the file with 3.3.5. I did not try to dump it and recreate >> with 3.5.6. >> > > With version 3.5.5, please do this: > > sqlite3 yourdatabasefile.db .schema >schema.txt > >

Re: [sqlite] SQLite>=3.5.6 does not open database file

2008-04-14 Thread D. Richard Hipp
On Apr 14, 2008, at 4:47 PM, Steve Topov wrote: > I can open the file with 3.3.5. I did not try to dump it and recreate > with 3.5.6. > With version 3.5.5, please do this: sqlite3 yourdatabasefile.db .schema >schema.txt then email me schema.txt file. D. Richard Hipp [EMAIL PROTECTED]

Re: [sqlite] Populating and scrolling the Listbox using query

2008-04-14 Thread Clay Dowling
Farzana wrote: > Dear All, > > We are working in eVC++ environment with SQLite database.We need to populate > the listbox with the values obtained by executing the query. > We were able to get the values of the query by using the API’s > sqlite3_prepare and sqlite3_step. > But we were able to

[sqlite] delete rows but the database files still have the big size

2008-04-14 Thread Joanne Pham
Hi All, I have used sqlite3 command to clean up ton of rows in the table by executing the following command sqlite3> delete from compressTable where appId > 10; The command above has deleted ~ 99% of the table and now this table has ~ 100 rows but the database file size is the same as before

Re: [sqlite] SQLite>=3.5.6 does not open database file

2008-04-14 Thread Steve Topov
1.8 Meg -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dennis Cote Sent: Monday, April 14, 2008 1:50 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLite>=3.5.6 does not open database file Steve Topov wrote: > I already reported

Re: [sqlite] SQLite>=3.5.6 does not open database file

2008-04-14 Thread D. Richard Hipp
On Apr 14, 2008, at 6:58 PM, Steve Topov wrote: > 1.8 Meg > email it to me, please. D. Richard Hipp [EMAIL PROTECTED] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQLite>=3.5.6 does not open database file

2008-04-14 Thread Steve Topov
I do not have sqlite3 command line tool. I work with dlls. If you email me sqlite3 I will create a dump. Compressed database file is 1.8 Meg. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of D. Richard Hipp Sent: Monday, April 14, 2008 1:59 PM To: General

Re: [sqlite] SQLite>=3.5.6 does not open database file

2008-04-14 Thread P Kishor
On 4/14/08, Steve Topov <[EMAIL PROTECTED]> wrote: > I do not have sqlite3 command line tool. I work with dlls. If you email > me sqlite3 I will create a dump. http://www.sqlite.org/sqlite-3_5_7.zip > Compressed database file is 1.8 Meg. > > > -Original Message- > From: [EMAIL

Re: [sqlite] SQLite>=3.5.6 does not open database file

2008-04-14 Thread D. Richard Hipp
On Apr 14, 2008, at 4:30 PM, Steve Topov wrote: > I already reported this bug but did not receive any responds so I am > trying one more time. > The problem: > SQLite version 3.5.6 and up returns an error when opening some > database > files. The error is “SQL logic error or missing database”.

Re: [sqlite] SQLite>=3.5.6 does not open database file

2008-04-14 Thread Steve Topov
I am on Windows XP using sqlite 3.5.6 dll created from the source. I debugged the code - Sqlite3_open returns OK but any other function after that returns 1. For example sqlite3_prepare returns 1 when I do "Select * from sqlite_master". Same for sqlite3_execute. Tried different SQL statements -

Re: [sqlite] SQLITE_LOCKED behavior

2008-04-14 Thread Shawn Wilsher
> Did you call sqlite3_reset() before each retry? Doing this fixed the issue. Thanks! Cheers, Shawn ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Comparison of SQLite applications for Mac

2008-04-14 Thread Dennis Cote
BareFeet wrote: > 2. Know of another application that should be included. > > You may want to include the free SQLite Manager add on for Firefox. See https://addons.mozilla.org/en-US/firefox/addon/5817 for additional information. It provides a general database browser and editor that works