Re: [sqlite] How to know the memory usage of an in-memory database.

2012-06-25 Thread Bo Peng
>> In any case, you set the cache size in pages by executing "PRAGMA >> cache_size=" after opening the database connection. I am using "PRAGMA cache_size=-300" to set the cache to 3G, but the process is still slow-going using 23M of RAM, despite the fact that it is reading small pieces of

Re: [sqlite] How to know the memory usage of an in-memory database.

2012-06-25 Thread Pavel Ivanov
On Mon, Jun 25, 2012 at 10:05 PM, Bo Peng wrote: >> Are these multiple tables in a single database (file), or multiple databases >> (files)?  Multiple connections or a single connection? > > Right now there are multiple read-only processes to read the same > file. If I go with

Re: [sqlite] How to know the memory usage of an in-memory database.

2012-06-25 Thread Bo Peng
> Are these multiple tables in a single database (file), or multiple databases > (files)?  Multiple connections or a single connection? Right now there are multiple read-only processes to read the same file. If I go with any RAM-based solution, I will have to use a single process to read

Re: [sqlite] How to know the memory usage of an in-memory database.

2012-06-25 Thread Keith Medcalf
Are these multiple tables in a single database (file), or multiple databases (files)? Multiple connections or a single connection? In any case, you set the cache size in pages by executing "PRAGMA cache_size=" after opening the database connection. You can test it without modifying your

Re: [sqlite] How to know the memory usage of an in-memory database.

2012-06-25 Thread Bo Peng
> Most of the problem is that by keeping the data in separate tables, you are > ensuring that you almost never get hits from cache.  Do these tables need to > be separate or can you merge them on disk ?  Do they have the same columns ? Unfortunately these tables can have slightly different

Re: [sqlite] How to know the memory usage of an in-memory database.

2012-06-25 Thread Bo Peng
On Mon, Jun 25, 2012 at 8:29 PM, Keith Medcalf wrote: > What OS is it that does not have a block disk cache? > > Have you tried simply allocating a large page cache? The application is cross-platform (python / sqlite / C). I frankly do not know how to create large page cache

Re: [sqlite] How to know the memory usage of an in-memory database.

2012-06-25 Thread Simon Slavin
On 26 Jun 2012, at 2:07am, Bo Peng wrote: > My application needs to run a lot of queries from a large sqlite > database (>100G) with many small tables (>10,000). The performance of > the queries are acceptable if the database is on a SSD drive, but can > be 50 times or more

Re: [sqlite] How to know the memory usage of an in-memory database.

2012-06-25 Thread Keith Medcalf
> My application needs to run a lot of queries from a large sqlite > database (>100G) with many small tables (>10,000). The performance of > the queries are acceptable if the database is on a SSD drive, but can > be 50 times or more slower on a regular or network drive. > Because some users have

[sqlite] How to know the memory usage of an in-memory database.

2012-06-25 Thread Bo Peng
Dear sqlite experts, My application needs to run a lot of queries from a large sqlite database (>100G) with many small tables (>10,000). The performance of the queries are acceptable if the database is on a SSD drive, but can be 50 times or more slower on a regular or network drive. Because some

Re: [sqlite] Problem with including sqlite3.c into c++ project

2012-06-25 Thread Keith Medcalf
> Im using MSVS 2010 for an c++ GUI project. > After including sqlite3.h and sqlite3.c from the amalgamation-3071200 > and with the Project Properties--> C/C++ --> Precompiled Headers --> > Precompiled Header --> Use (/Yu) > I get the error > sqlite3.c : fatal error C1853: 'Debug\Contegos_UI.pch'

Re: [sqlite] C++ - ISERT from a data object

2012-06-25 Thread Keith Medcalf
> >> are not very useful in a real life C++ GUI application. > > That thing you quoted above ... the thing between the double quotes ... is > a string. You can make up the string yourself by concatenating several > strings together. > I may be a bit oversensitive here, but that seems like an

Re: [sqlite] C++ - ISERT from a data object

2012-06-25 Thread Arbol One
My friend, heavens awaits you. Outstanding! Thanks man! -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik Sent: Monday, June 25, 2012 7:32 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] C++ - ISERT from a

Re: [sqlite] Problem with including sqlite3.c into c++ project

2012-06-25 Thread Teg
AD> Do not use precompiled headers on sqlite3.c This. My Sqlite is in it's own library project so, it can have different precompiled header settings than my other projects. About 80% of my projects use procompiled headers, the other 20 are typically made of code like Sqlite which don't have

Re: [sqlite] C++ - ISERT from a data object

2012-06-25 Thread Igor Tandetnik
Arbol One wrote: > In my GUI application the user enters a information that will go in a SQLite > database table, so statements like: > > string dbdata = "INSERT INTO friend (name, address, age) VALUES ('Caramba', > '490 New Bridge', '49')"; > > > > are not very useful in

Re: [sqlite] C++ - ISERT from a data object

2012-06-25 Thread Robert Myers
On 6/25/2012 5:58 PM, Simon Slavin wrote: On 25 Jun 2012, at 11:36pm, Arbol One wrote: In my GUI application the user enters a information that will go in a SQLite database table, so statements like: string dbdata = "INSERT INTO friend (name, address, age) VALUES

Re: [sqlite] C++ - ISERT from a data object

2012-06-25 Thread Simon Slavin
On 25 Jun 2012, at 11:36pm, Arbol One wrote: > In my GUI application the user enters a information that will go in a SQLite > database table, so statements like: > > string dbdata = "INSERT INTO friend (name, address, age) VALUES ('Caramba', > '490 New Bridge', '49')"; > >

[sqlite] C++ - ISERT from a data object

2012-06-25 Thread Arbol One
In my GUI application the user enters a information that will go in a SQLite database table, so statements like: string dbdata = "INSERT INTO friend (name, address, age) VALUES ('Caramba', '490 New Bridge', '49')"; are not very useful in a real life C++ GUI application. I would assume that

Re: [sqlite] Problem with including sqlite3.c into c++ project

2012-06-25 Thread deltagam...@gmx.net
Am 25.06.2012 22:18, schrieb John Drescher: On Mon, Jun 25, 2012 at 4:15 PM, deltagam...@gmx.net wrote: Hello, Im using MSVS 2010 for an c++ GUI project. After including sqlite3.h and sqlite3.c from the amalgamation-3071200 and with the Project Properties--> C/C++ -->

Re: [sqlite] Problem with including sqlite3.c into c++ project

2012-06-25 Thread Adam DeVita
Do not use precompiled headers on sqlite3.c On Mon, Jun 25, 2012 at 4:22 PM, Pavel Ivanov wrote: > On Mon, Jun 25, 2012 at 4:15 PM, deltagam...@gmx.net > wrote: > > Hello, > > > > Im using MSVS 2010 for an c++ GUI project. > > After including sqlite3.h

Re: [sqlite] Problem with including sqlite3.c into c++ project

2012-06-25 Thread Pavel Ivanov
On Mon, Jun 25, 2012 at 4:15 PM, deltagam...@gmx.net wrote: > Hello, > > Im using MSVS 2010 for an c++ GUI project. > After including sqlite3.h and sqlite3.c from the amalgamation-3071200 > and with the Project Properties--> C/C++  --> Precompiled Headers --> > Precompiled

Re: [sqlite] Problem with including sqlite3.c into c++ project

2012-06-25 Thread John Drescher
On Mon, Jun 25, 2012 at 4:15 PM, deltagam...@gmx.net wrote: > Hello, > > Im using MSVS 2010 for an c++ GUI project. > After including sqlite3.h and sqlite3.c from the amalgamation-3071200 > and with the Project Properties--> C/C++  --> Precompiled Headers --> > Precompiled

[sqlite] Problem with including sqlite3.c into c++ project

2012-06-25 Thread deltagam...@gmx.net
Hello, Im using MSVS 2010 for an c++ GUI project. After including sqlite3.h and sqlite3.c from the amalgamation-3071200 and with the Project Properties--> C/C++ --> Precompiled Headers --> Precompiled Header --> Use (/Yu) I get the error sqlite3.c : fatal error C1853: 'Debug\Contegos_UI.pch'

Re: [sqlite] I consider this a bug. Anyone else?

2012-06-25 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 25/06/12 11:21, Andrew Rondeau wrote: > IMO, I've been somewhat dissapointed with sqlite's deployment scenario > on Windows. Perhaps this is an area that needs a bit more community > involvement? You really are looking this the wrong way.

Re: [sqlite] C++ programming - Extracting data

2012-06-25 Thread Arbol One
Yes, yes!! thank you, now I understand!! Superb! Thanks Michael! -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Black, Michael (IS) Sent: Monday, June 25, 2012 11:03 AM To: General Discussion of SQLite Database Subject: Re:

Re: [sqlite] I consider this a bug. Anyone else?

2012-06-25 Thread Andrew Rondeau
IMO, I've been somewhat dissapointed with sqlite's deployment scenario on Windows. Perhaps this is an area that needs a bit more community involvement? On Mon, Jun 25, 2012 at 5:58 AM, Richard Hipp wrote: > On Sun, Jun 24, 2012 at 1:04 PM, Bill Pytlovany wrote:

Re: [sqlite] EXT :Re: Can't create empty database

2012-06-25 Thread Tim Streater
On 25 Jun 2012 at 14:30, Niall O'Reilly wrote: > On 25 Jun 2012, at 13:24, Black, Michael (IS) wrote: > >> Does the shell compile differently for Mac? > > Sorry. I've no idea whether it does. > SQLite comes bundled with OSX and I haven't had a need to build it

Re: [sqlite] C++ programming - Extracting data

2012-06-25 Thread Black, Michael (IS)
You were doing two sqlite3_step()'s instead of one. So you skipped the one record you had inserted. You can run this multiple times and you;; see error messages about the create table on 2nd and subsequent runs. Still adds the same record though so you'll see +1 records get printed out for

Re: [sqlite] C++ programming - Extracting data

2012-06-25 Thread Keith Medcalf
Your logic is incorrect. You have already stepped to the first row before you enter the loop, which starts out by stepping again, thus exhausting the returned data (since you only have one row). If you insert multiple rows your code may work but leave out the first row. Try something like:

Re: [sqlite] C++ programming - Extracting data

2012-06-25 Thread Arbol One
I did what you suggested, you were right, now the exception is gone, but the program now does not display anything, it just goes to the end of the method. Here is a more complete snip of the test bench program. I really hope that someone here can help resolve this issue. // TEST BENCH // 1.

Re: [sqlite] C++ programming - Extracting data

2012-06-25 Thread Black, Michael (IS)
You're not doing the right sequencing...so your cout is only executing when there is NOT a row. Change rc = sqlite3_step(stmt); if(rc != SQLITE_DONE) { ... } while ( sqlite3_step(stmt) != SQLITE_ROW) { sName = (char*)sqlite3_column_text(stmt, 0); //<== Seg fault

Re: [sqlite] C++ programming - Extracting data

2012-06-25 Thread Keith Medcalf
> while ( sqlite3_step(stmt) != SQLITE_ROW) { > sName = (char*)sqlite3_column_text(stmt, 0); //<== Seg fault > std::cout << sName << std::endl; > ... > } You can only access columns when you have a row, not when you don't. --- () ascii ribbon campaign against html

Re: [sqlite] EXT :Re: Can't create empty database

2012-06-25 Thread Niall O'Reilly
On 25 Jun 2012, at 13:24, Black, Michael (IS) wrote: > Does the shell compile differently for Mac? Sorry. I've no idea whether it does. SQLite comes bundled with OSX and I haven't had a need to build it from source. Besides, I haven't needed either to upgrade (?) to

Re: [sqlite] C++ programming - Extracting data

2012-06-25 Thread Arbol One
Sorry, I forgot to give you a snip of the test-bench code getter() { string sName; string sAddress; int age = 0; string dbdata = "SELECT * FROM friend"; rc = sqlite3_prepare_v2(db, dbdata.c_str(), -1, , NULL ); rc = sqlite3_step(stmt); if(rc != SQLITE_DONE) {

Re: [sqlite] EXT :Re: Can't create empty database

2012-06-25 Thread Simon Slavin
On 25 Jun 2012, at 1:24pm, "Black, Michael (IS)" wrote: > I'd be surprised if the shell behaves differently on the Mac...that' s just > Unix-like under the hood so I'd figure it would act just like Linux. Does > the shell compile differently for Mac? I can tell you

Re: [sqlite] C++ programming - creating a table

2012-06-25 Thread Igor Tandetnik
Arbol One wrote: > Q: What are you trying to achieve here? What's the supposed purpose of > sqlite3_column_type call? > > A: What I am trying to do is to display the data in a data table You run a SELECT statement for that. In any case, what data do you expect there to be

Re: [sqlite] I consider this a bug. Anyone else?

2012-06-25 Thread Richard Hipp
On Sun, Jun 24, 2012 at 1:04 PM, Bill Pytlovany wrote: > Can the download page include a distributable version without debug > information or would this require paid support? > Anyone else thinks this is a bug? > A "bug" is when the software gets the wrong answer. This is not a

Re: [sqlite] C++ programming - creating a table

2012-06-25 Thread Arbol One
Q: What are you trying to achieve here? What's the supposed purpose of sqlite3_column_type call? A: What I am trying to do is to display the data in a data table, but the statement std::cout << (char*)sqlite3_column_text(stmt, 0) << std::endl; produces a segmentation error.

Re: [sqlite] I consider this a bug. Anyone else?

2012-06-25 Thread Igor Tandetnik
Bill Pytlovany wrote: > Can the download page include a distributable version without debug > information or would this require paid support? You are free (both as in speech and as in beer) to build your own from source, using any options you want. It doesn't even have to be a

Re: [sqlite] I consider this a bug. Anyone else?

2012-06-25 Thread PA Newsgroups
Having Debug data isn't a concern for me (but maybe for others?), but not having a version number in SQLite.DLL is a bit of a pain. It means installers can't treat the DLL like every other DLL out there and instead need to rely on file timestamps which is not the greatest. Doug -Original

[sqlite] I consider this a bug. Anyone else?

2012-06-25 Thread Bill Pytlovany
I'm very pleased with sqlite3.dll for Windows and I mainly include it with my product because one of our features is to help users manage cookies. Since both Chrome and Firefox use SQLite I'm required to use sqlite3.dll to access their information. So thank you, thank you! I've asked this in the

Re: [sqlite] EXT :Re: Can't create empty database

2012-06-25 Thread Black, Michael (IS)
I'd be surprised if the shell behaves differently on the Mac...that' s just Unix-like under the hood so I'd figure it would act just like Linux. Does the shell compile differently for Mac? Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit

Re: [sqlite] Can't create empty database

2012-06-25 Thread Valentin Davydov
On Mon, Jun 25, 2012 at 01:01:46AM -0700, L Anderson wrote: > Googling on how to create a sqlite database (empty one) it appears > I need only do 'sqlite3 test.db'. However, when I try that I get: > > ->sqlite3 test.db > SQLite version 3.7.13 2012-06-11 02:05:22 > Enter ".help" for instructions

Re: [sqlite] Can't create empty database

2012-06-25 Thread Niall O'Reilly
On 25 Jun 2012, at 12:48, Black, Michael (IS) wrote: > Well...it doesnt' any more on Windows and Linux at least as of 3.7.9 > > The file doesn't get created until you execute at least one command relevant > to it. > > So do a .schema or .dump or such and it creates the empty file. > > Or

Re: [sqlite] Can't create empty database

2012-06-25 Thread Black, Michael (IS)
Well...it doesnt' any more on Windows and Linux at least as of 3.7.9 The file doesn't get created until you execute at least one command relevant to it. So do a .schema or .dump or such and it creates the empty file. Or just enter a ";" and it will create it too (ergo the "" works from

Re: [sqlite] Can't create empty database

2012-06-25 Thread Niall O'Reilly
On 25 Jun 2012, at 11:06, L Anderson wrote: > So then on page 'http://www.sqlite.org/quickstart.html' > under 'Create A New Database', the first bullet: > > 'At a shell or DOS prompt, enter: "sqlite3 test.db". This will create a new > database named "test.db". (You can use a different name if

Re: [sqlite] Can't create empty database

2012-06-25 Thread L Anderson
Oliver Peters wrote: Am 25.06.2012 10:01, schrieb L Anderson: Googling on how to create a sqlite database (empty one) it appears I need only do 'sqlite3 test.db'. However, when I try that I get: ->sqlite3 test.db SQLite version 3.7.13 2012-06-11 02:05:22 Enter ".help" for instructions Enter

Re: [sqlite] Can't create empty database

2012-06-25 Thread L Anderson
Patrik Nilsson wrote: sqlite3 test.db "" It creates an empty file, zero bytes long. Thanks for your quick reply. So then on page 'http://www.sqlite.org/quickstart.html' under 'Create A New Database', the first bullet: 'At a shell or DOS prompt, enter: "sqlite3 test.db". This will create a

Re: [sqlite] Can't create empty database

2012-06-25 Thread Oliver Peters
Am 25.06.2012 10:01, schrieb L Anderson: Googling on how to create a sqlite database (empty one) it appears I need only do 'sqlite3 test.db'. However, when I try that I get: ->sqlite3 test.db SQLite version 3.7.13 2012-06-11 02:05:22 Enter ".help" for instructions Enter SQL statements

Re: [sqlite] Can't create empty database

2012-06-25 Thread Patrik Nilsson
sqlite3 test.db "" It creates an empty file, zero bytes long. On 06/25/2012 10:01 AM, L Anderson wrote: > Googling on how to create a sqlite database (empty one) it appears > I need only do 'sqlite3 test.db'. However, when I try that I get: > > ->sqlite3 test.db > SQLite version 3.7.13

[sqlite] Can't create empty database

2012-06-25 Thread L Anderson
Googling on how to create a sqlite database (empty one) it appears I need only do 'sqlite3 test.db'. However, when I try that I get: ->sqlite3 test.db SQLite version 3.7.13 2012-06-11 02:05:22 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> however, no

Re: [sqlite] C++ programming - inserting data in a table

2012-06-25 Thread Simon Slavin
On 25 Jun 2012, at 5:16am, Arbol One wrote: > Thanks for the prompt response. > Here is the same problem when using INSERT. Read Igor's post again. The only SQL commands which produce output are SELECT and (sometimes) PRAGMA. Commands which make changes to your database,