Re: [sqlite] Re: Re: Re: Re: sqlite3_prepare16 and LIKE

2006-10-30 Thread Jonas Sandman
On 10/30/06, Igor Tandetnik <[EMAIL PROTECTED]> wrote: Jonas Sandman <[EMAIL PROTECTED]> wrote: > #define SELECT_STATEMENT_TEXTSORT L"SELECT * FROM Data WHERE > (Data.titleLIKE (SELECT '%%' || ? || '%') OR > Data.artist LIKE (SELECT '%' || ? || '%') OR Data.album LIKE (SELECT > '%' || ? || '%')

Re: [sqlite] serious performance problems with indexes

2006-10-30 Thread Joe Wilson
If you have only one index, then pre-sorting your large datasets prior to inserting with the default sqlite cache will yield twice as good insert performance as not pre-sorting your data and using a huge cache. This stands to reason since you're basically appending pages to the end of the

Re: [sqlite] Memory Usage

2006-10-30 Thread Eduardo
At 14:40 30/10/2006, you wrote: I am suffering a 4GB memory 64-bit Zeon Linux box, which keeps crashing with 'No available memory'. I'm finding it quite hard to break down the memory into what processes are paged-in and using what's available. Sqlite seemed to be the smoking gun, so although

[sqlite] Re: SQL that is stumping me

2006-10-30 Thread Igor Tandetnik
Doug Nebeker <[EMAIL PROTECTED]> wrote: Imagine I have the following data: TimeStamp | Person | Data1 --- 1 | Doug | X 2 | Doug | Y 2 | Fred | A 3 | Doug | Z 4 | Fred | B How do I set all Data1 values for each

Re: [sqlite] password on database, can i have?

2006-10-30 Thread drh
"=?UTF-8?Q?R=C3=BAben_L=C3=ADcio?=" <[EMAIL PROTECTED]> wrote: > I need protect my database with a password, can i do it??? > http://www.hwaci.com/sw/sqlite/prosupport.html#crypto -- D. Richard Hipp <[EMAIL PROTECTED]>

Re: [sqlite] Re: Re: Re: sqlite3_prepare16 and LIKE

2006-10-30 Thread Clark Christensen
Possible typo in the first sub condition of your WHERE clause. I'm sure you mean to say, "Data.title LIKE ", instead of "Data.titleLIKE". Also, I don't think SQLite lets you write a parameterized query like this. I think you have to concatenate the percents and your input string and pass the

[sqlite] SQL that is stumping me

2006-10-30 Thread Doug Nebeker
I have a generic SQL question for the less-newbie-than-me out there. Imagine I have the following data: TimeStamp | Person | Data1 --- 1 | Doug | X 2 | Doug | Y 2 | Fred | A 3 | Doug | Z 4 | Fred | B How do I set all

Re: [sqlite] Re: Re: Re: sqlite3_prepare16 and LIKE

2006-10-30 Thread Jonas Sandman
#define SELECT_STATEMENT_TEXTSORT L"SELECT * FROM Data WHERE (Data.titleLIKE (SELECT '%%' || ? || '%') OR Data.artist LIKE (SELECT '%' || ? || '%') OR Data.album LIKE (SELECT '%' || ? || '%') OR Data.genre LIKE (SELECT '%' || ? || '%') OR Data.comment LIKE (SELECT '%' || ? || '%') OR Data.path

[sqlite] Re: Re: Re: sqlite3_prepare16 and LIKE

2006-10-30 Thread Igor Tandetnik
Jonas Sandman <[EMAIL PROTECTED]> wrote: Yes, but path isn't part of the query. I ask for query = "", path = "C:\MP3\Albums" and I get all the results in the entire database. If I set query = "madonna" and same path. I get no results. Use parentheses to achieve this result. Okay, that

Re: [sqlite] Re: Re: sqlite3_prepare16 and LIKE

2006-10-30 Thread Jonas Sandman
On 10/30/06, Igor Tandetnik <[EMAIL PROTECTED]> wrote: Jonas Sandman <[EMAIL PROTECTED]> wrote: >> Data.artist LIKE (SELECT '%' || ? || '%') OR Data.album LIKE (SELECT >>> '%' || ? || '%') OR Data.genre LIKE (SELECT '%' || ? || '%') OR >>> Data.comment LIKE (SELECT '%' || ? || '%') AND

[sqlite] password on database, can i have?

2006-10-30 Thread Rúben Lício
I need protect my database with a password, can i do it??? ty, Rúben -- Linux user #433535 Linux because we are freedon.

Re: [sqlite] Re: sqlite3_prepare16 and LIKE

2006-10-30 Thread Jonas Sandman
On 10/30/06, Igor Tandetnik <[EMAIL PROTECTED]> wrote: Jonas Sandman <[EMAIL PROTECTED]> wrote: > I have created a database like this: > > CREATE TABLE Data (path VARCHAR(512) PRIMARY KEY, title VARCHAR(512), > artist VARCHAR(512), album VARCHAR(512), length INTEGER, genre > VARCHAR(512),

[sqlite] Re: sqlite3_prepare16 and LIKE

2006-10-30 Thread Igor Tandetnik
Jonas Sandman <[EMAIL PROTECTED]> wrote: I have created a database like this: CREATE TABLE Data (path VARCHAR(512) PRIMARY KEY, title VARCHAR(512), artist VARCHAR(512), album VARCHAR(512), length INTEGER, genre VARCHAR(512), comment VARCHAR(512), track INTEGER, year INTEGER, bitrate INTEGER,

[sqlite] sqlite3_prepare16 and LIKE

2006-10-30 Thread Jonas Sandman
I have created a database like this: CREATE TABLE Data (path VARCHAR(512) PRIMARY KEY, title VARCHAR(512), artist VARCHAR(512), album VARCHAR(512), length INTEGER, genre VARCHAR(512), comment VARCHAR(512), track INTEGER, year INTEGER, bitrate INTEGER, playcount INTEGER, changed INTEGER, size

Re: [sqlite] Memory Usage

2006-10-30 Thread Dennis Jenkins
If you are seeing different memory usage patterns for identical code based on if it is run from xinetd or on your command line, then I would check the process environment that xinetd creates. Maybe some component that sqlite uses is acting differently based on environment variables? I

Re: [sqlite] serious performance problems with indexes

2006-10-30 Thread Peter De Rijk
On Sunday 29 October 2006 18:47, Joe Wilson wrote: > The last test that simulated pre-sorting 2 million rows > in index order prior to insert may show optimal insert speed > since it's only appending pages to the table and the index, > but it may not be realistic, since you may not have sufficient

[sqlite] Re: Re: efficient way to figure out if a table is empty

2006-10-30 Thread Igor Tandetnik
Rob Sciuk wrote: On Mon, 30 Oct 2006, Igor Tandetnik wrote: Date: Mon, 30 Oct 2006 11:21:15 -0500 From: Igor Tandetnik <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: SQLite <[EMAIL PROTECTED]> Subject: [sqlite] Re: efficient way to figure out if a table is empty Xavier Noria <[EMAIL

Re: [sqlite] efficient way to figure out if a table is empty

2006-10-30 Thread Dennis Cote
Xavier Noria wrote: Not that is critical for my application, but just for curiosity which is the recommended idiom to figure out whether a table has any register? Xavier, You can of course use the most direct method, counting records and comparing like this. select count(*) > 0 from t;

Re: [sqlite] Re: efficient way to figure out if a table is empty

2006-10-30 Thread Rob Sciuk
On Mon, 30 Oct 2006, Igor Tandetnik wrote: > Date: Mon, 30 Oct 2006 11:21:15 -0500 > From: Igor Tandetnik <[EMAIL PROTECTED]> > Reply-To: sqlite-users@sqlite.org > To: SQLite > Subject: [sqlite] Re: efficient way to figure out if a table is empty > > Xavier Noria <[EMAIL

[sqlite] Re: efficient way to figure out if a table is empty

2006-10-30 Thread Igor Tandetnik
Xavier Noria <[EMAIL PROTECTED]> wrote: Not that is critical for my application, but just for curiosity which is the recommended idiom to figure out whether a table has any register? select exists (select * from tablename); Igor Tandetnik

[sqlite] efficient way to figure out if a table is empty

2006-10-30 Thread Xavier Noria
Not that is critical for my application, but just for curiosity which is the recommended idiom to figure out whether a table has any register? -- fxn - To unsubscribe, send email to [EMAIL PROTECTED]

Re: [sqlite] Memory Usage

2006-10-30 Thread John Stanton
What happens when you write a simple test program to open the DB? You can certainly run Valgrind on that or even put in your own debug statements to examine the heap usage. This would be the first thing to do in indentifying the problem. It will tell you whether to look at Sqlite or your

Re: [sqlite] Using SQLite in threadly Web server applications

2006-10-30 Thread John Stanton
At some point shared usage of a single resource involves some form of synchronization. If you use Sqlite the you need to add that capability somehow. Sqlite lets you use file locks fairly simply for that purpose if that suits your application. An alternative is to use something like

Re: [sqlite] Memory Usage

2006-10-30 Thread Martin Jenkins
Ben Clewett wrote: If you know a good URL on Linux virtual memory and allocation, I would be extremely interested. You could try: http://virtualthreads.blogspot.com/2006/02/understanding-memory-usage-on-linux.html The next two link to pages with links to a PDF of the "gorman" book

Re: [sqlite] Memory Usage

2006-10-30 Thread Ben Clewett
Hi Nuno, Sqlite is one mailing list I have consistently found absolutely excelent knowledge, thanks again for your information. I don't know whether this should be off-thread now, but I don't have your email address. I'll have to research memory allocation further. But I'm glad to know

Re: [sqlite] Memory Usage

2006-10-30 Thread Lloyd
I don't know whether I am right in this perspective. Just to know whether sqlite is causing the high memory usage, comment the commands (statements) related to sqlite and check the memory status. Thanks, Lloyd. On Mon, 2006-10-30 at 12:45 +, Nuno Lucas wrote: > On 10/30/06, Ben Clewett

Re: [sqlite] Memory Usage

2006-10-30 Thread Nuno Lucas
On 10/30/06, Ben Clewett <[EMAIL PROTECTED]> wrote: Nuno, Thanks for the excelent description of my error. I have learnt a little more about Linux virtual memory model. Very glad to hear Sqlite is as perfect as ever :) My problem, which is definitely my problem, is that 90 x 16MB of reserved

Re: [sqlite] Memory Usage 2

2006-10-30 Thread drh
Ben Clewett <[EMAIL PROTECTED]> wrote: > > Is the allocation of 4108 KB normal for Sqlite? No. Not for me. If you open the same database using the command-line client, how much memory does it use? > Why, then run from xined, is the memory allocation four times as much? > Why is just Sqlite

Re: [sqlite] Memory Usage

2006-10-30 Thread Ben Clewett
Nuno, Thanks for the excelent description of my error. I have learnt a little more about Linux virtual memory model. Very glad to hear Sqlite is as perfect as ever :) My problem, which is definitely my problem, is that 90 x 16MB of reserved memory is still a loss of 1.4G. Especially as I

Re: [sqlite] Memory Usage

2006-10-30 Thread Nuno Lucas
On 10/30/06, Ben Clewett <[EMAIL PROTECTED]> wrote: Hi Numo and others, I am very glad to hear the consensus is that there is nothing wrong with libsqlite3.so.0.8.6. However the fact is that the 'open' still acquires 16MB of memory. Immediately Before: VmSize: 8572 kB