Re: [sqlite] Is there always an index on ROWID?

2008-02-20 Thread Jos van den Oever
2008/2/21, Neville Franks <[EMAIL PROTECTED]>: > If I create a table with a Primary key on a TEXT clm, will there still > be an Index on the in-built ROWID clm. The reason for asking this is > that I need fast (indexed) lookup to rows by both ROWID and my TEXT > clm. According to the documenta

[sqlite] How to Optimize query

2008-02-20 Thread Manoj Marathayil
Hi, I am working with a project which uses SQLite as the database to store collected data. I am issuing the following query to retrieve data from the table. I noticed this query is taking more time as the number of records in the table increases. Is there a better way to write this query? any help

[sqlite] Checking that a row exists?

2008-02-20 Thread Gilles Ganault
Hello Is this the standard way to check that a row exists in PHP/SQLite, or is there a better syntax? $query = "SELECT count(*) FROM contacts WHERE contacts_phones_tel GLOB '%s*'; $query = sprintf($query,$row['calls_phones_tel']); $query = $dbh->query($sql)->fetch(); if(!$query[0]) {

Re: [sqlite] Is there always an index on ROWID?

2008-02-20 Thread Neville Franks
Hi Jeff, Thanks, I thought that would be the case, but didn't want to start creating tables etc. and find I was wrong. Sorry about the spam-challenge you received. I didn't have it setup right for this list. Thursday, February 21, 2008, 11:30:51 AM, you wrote: JH> The table data is stored in a

Re: [sqlite] Is there always an index on ROWID?

2008-02-20 Thread Jeff Hamilton
The table data is stored in a b-tree keyed off of the rowid, so lookups based on rowid should always be fast. -Jeff On Wed, Feb 20, 2008 at 6:27 PM, Neville Franks <[EMAIL PROTECTED]> wrote: > Hi, > If I create a table with a Primary key on a TEXT clm, will there still > be an Index on the in-b

[sqlite] Is there always an index on ROWID?

2008-02-20 Thread Neville Franks
Hi, If I create a table with a Primary key on a TEXT clm, will there still be an Index on the in-built ROWID clm. The reason for asking this is that I need fast (indexed) lookup to rows by both ROWID and my TEXT clm. I am just starting out with SQLite and have almost finished Michael Owens book,

Re: [sqlite] Most widely deployed?

2008-02-20 Thread Bogdan Eugen Daja
The most important: free, slim, fast, easy to install, works on your pocket :) this is SQLite What I looking for is oracle for ppc but i guess wont get enounght space to install. Toby Roworth wrote: > Bryan Oakley wrote: > >> On Feb 20, 2008 7:41 AM, Toby Roworth <[EMAIL PROTECTED]> wrote:

Re: [sqlite] Limit number of records to search in a table in SQlite

2008-02-20 Thread P Kishor
On 2/20/08, Kalyani Phadke <[EMAIL PROTECTED]> wrote: > > Suppose I have 1280009 rows in table. > CREATE TABLE TableA > ( > ID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, >column1 VARCHAR (50) NOT NULL, >column2 VARCHAR (50) NOT NULL, >column3 TIMESTAMP NOT NULL DEFAULT (CURRE

Re: [sqlite] Limit number of records to search in a table in SQlite

2008-02-20 Thread Dennis Cote
Kalyani Phadke wrote: > > Any suggestions? > Please stop hijacking message threads. http://en.wikipedia.org/wiki/Thread_hijacking Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite

[sqlite] Limit number of records to search in a table in SQlite

2008-02-20 Thread Kalyani Phadke
Suppose I have 1280009 rows in table. CREATE TABLE TableA ( ID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, column1 VARCHAR (50) NOT NULL, column2 VARCHAR (50) NOT NULL, column3 TIMESTAMP NOT NULL DEFAULT (CURRENT_TIMESTAMP), column4 VARCHAR (128) NULL, column5 VAR

Re: [sqlite] Access to SQLite via two languages in one process

2008-02-20 Thread Nicolas Williams
On Wed, Feb 20, 2008 at 04:50:47PM +, [EMAIL PROTECTED] wrote: > Private messages on this subject suggest that I have misunderstood > the question. What exactly do you mean by "instances" of SQLite? Two instances of libsqlite3.a linked into different parts of the process. > If you create two

Re: [sqlite] Access to SQLite via two languages in one process

2008-02-20 Thread drh
Nicolas Williams <[EMAIL PROTECTED]> wrote: > On Wed, Feb 20, 2008 at 04:23:29PM +, [EMAIL PROTECTED] wrote: > > Nicolas Williams <[EMAIL PROTECTED]> wrote: > > > does SQLite know about POSIX file locks on the same files from > > > other instances of itself? > > > > Yes. That's the whole poin

Re: [sqlite] bit operations in select statements

2008-02-20 Thread Ken
select key where value & '01011'; Try: select key where (value&176) you need to convert the bit string to an integer number. Also be aware that sqlite interperts numbers as signed 64 bit integer and this can cause some issues with your bit mask number. HTH. Jos van d

Re: [sqlite] Access to SQLite via two languages in one process

2008-02-20 Thread Nicolas Williams
On Wed, Feb 20, 2008 at 04:23:29PM +, [EMAIL PROTECTED] wrote: > Nicolas Williams <[EMAIL PROTECTED]> wrote: > > does SQLite know about POSIX file locks on the same files from > > other instances of itself? > > Yes. That's the whole point of POSIX advisory locking. src/os_unix.c says: ** He

Re: [sqlite] Please test lastest CVS using WinCE

2008-02-20 Thread Fin Springs
> For that matter, is there anybody out there who would like > to become the official wince maintainer for SQLite? If you > are able to compile, test, and debug SQLite for wince and I could do that if you'd like Richard. We develop our own Windows CE 5.0 based device so I have access to Platform

Re: [sqlite] Access to SQLite via two languages in one process

2008-02-20 Thread drh
Nicolas Williams <[EMAIL PROTECTED]> wrote: > does SQLite know about POSIX file locks on the same files from > other instances of itself? Yes. That's the whole point of POSIX advisory locking. -- D. Richard Hipp <[EMAIL PROTECTED]> ___ sqlite-users ma

Re: [sqlite] Access to SQLite via two languages in one process

2008-02-20 Thread Nicolas Williams
On Wed, Feb 20, 2008 at 10:58:05AM -0500, Igor Tandetnik wrote: > Sam Carleton <[EMAIL PROTECTED]> wrote: > > I am working on a application that is currently access the SQLite > > database via PHP that is running under Apache as a module. The > > application also has a custom written Apache module

Re: [sqlite] Access to SQLite via two languages in one process

2008-02-20 Thread Igor Tandetnik
Sam Carleton <[EMAIL PROTECTED]> wrote: > I am working on a application that is currently access the SQLite > database via PHP that is running under Apache as a module. The > application also has a custom written Apache module written in C. Can > I access the the SQLite database from both PHP and

Re: [sqlite] Most widely deployed?

2008-02-20 Thread Toby Roworth
Bryan Oakley wrote: > On Feb 20, 2008 7:41 AM, Toby Roworth <[EMAIL PROTECTED]> wrote: > >> Oracle has deployment contracts in the govornments of X countries >> worldwide, each having Y department, which have Z number of databases >> each... >> > > I would think the number of MacOSX install

Re: [sqlite] Optimization Question - multithread prepare ?

2008-02-20 Thread John Stanton
Mark Gilbert wrote: >> > - We don't currently prepare SQL statements in advance, would this >>> technique benefit from somehow preparing statements *before* that >>> thread gets the lock on the database ? Can we have multiple threads >>> using the SAME database connection preparing SQL Queries

Re: [sqlite] Most widely deployed?

2008-02-20 Thread Bryan Oakley
On Feb 20, 2008 7:41 AM, Toby Roworth <[EMAIL PROTECTED]> wrote: > Oracle has deployment contracts in the govornments of X countries > worldwide, each having Y department, which have Z number of databases > each... I would think the number of MacOSX installations would outnumber the Oracle install

Re: [sqlite] Optimization Question - multithread prepare ?

2008-02-20 Thread Mark Gilbert
> > > - We don't currently prepare SQL statements in advance, would this >> technique benefit from somehow preparing statements *before* that >> thread gets the lock on the database ? Can we have multiple threads >> using the SAME database connection preparing SQL Queries at the same >> time

[sqlite] Access to SQLite via two languages in one process

2008-02-20 Thread Sam Carleton
I am working on a application that is currently access the SQLite database via PHP that is running under Apache as a module. The application also has a custom written Apache module written in C. Can I access the the SQLite database from both PHP and the Apache module? Sam ___

Re: [sqlite] Most widely deployed?

2008-02-20 Thread Toby Roworth
Geoff Lane wrote: > On Wed, Feb 20, 2008 at 01:41:50PM +, Toby Roworth wrote: > >> I'm not trying to be picky here, or start telling you that you're wrong, >> but it could be worth changing - if an oracle developer (etc) were to >> look at the page, the could potentially have a field day w

Re: [sqlite] Most widely deployed?

2008-02-20 Thread Geoff Lane
On Wed, Feb 20, 2008 at 01:41:50PM +, Toby Roworth wrote: > I'm not trying to be picky here, or start telling you that you're wrong, > but it could be worth changing - if an oracle developer (etc) were to > look at the page, the could potentially have a field day when they can > point out so

Re: [sqlite] bit operations in select statements

2008-02-20 Thread Jens Miltner
Am 20.02.2008 um 11:54 schrieb Jos van den Oever: > Hi all, > > Is it possible to use logic operations on fields, in particular on > integers and on fixed sized blobs (256 bits/32 bytes). > I'd like to do queries like this: > select key where number_of_bits_set(value) = 10; I believe for this ki

[sqlite] Most widely deployed?

2008-02-20 Thread Toby Roworth
I was just reading the page about SQlite being the most widely deployed SQL database engine (http://sqlite.org/mostdeployed.html), and noticed that it does not seem to take into account non-website non-sqlite database engines in the arbitrary 100million other database engines. I'm not trying to

Re: [sqlite] Optimization Question - multithread prepare ?

2008-02-20 Thread Jens Miltner
Am 20.02.2008 um 14:03 schrieb Mark Gilbert: > Folks. > > Our application uses SQlite on Mac OSX. It is a central data hub for > a larger infrastructure and manages data coming in from some clients, > and requests for data from other clients, using our own XML based > protocols via TCPIP. > > It

[sqlite] Time to rewrite DBMS, says Ingres founder

2008-02-20 Thread Ion Silvestru
http://www.regdeveloper.co.uk/2008/02/18/stonebraker_dbms_outdated/ ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Virtual Tables performance

2008-02-20 Thread Eric Grange
We've begun implementing some virtual tables with latest SQLite build and run into a few questions performance-wise, all these questions revolve around the same issue (join performance). 1) Is there a way to know which fields are going to be potentially requested by xColumn? For instance if I have

[sqlite] Optimization Question - multithread prepare ?

2008-02-20 Thread Mark Gilbert
Folks. Our application uses SQlite on Mac OSX. It is a central data hub for a larger infrastructure and manages data coming in from some clients, and requests for data from other clients, using our own XML based protocols via TCPIP. Its somewhat like a web server with a backend system supplyi

Re: [sqlite] SQLite slow on WindowsXP

2008-02-20 Thread Michał Bartyzel
really works! thanks a lot Nuno Lucas pisze: > On Feb 20, 2008 11:06 AM, Michał Bartyzel <[EMAIL PROTECTED]> wrote: > >> Hi, >> >> I use the newest version of SQLite - 3.5.6. >> I have 9 MB file with insert statements to ".read" into the data base. >> When I run it under Linux it takes up to 20

Re: [sqlite] Easy question concerning C++ & sqlite3

2008-02-20 Thread Igor Tandetnik
"vl.pavlov" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > there is expression: > > select count(number) from words where word = bla > > which, if i am right, searches through whole table Not if you have an index on "word". And you need a unique index anyway for "insert or replace"

Re: [sqlite] SQLite slow on WindowsXP

2008-02-20 Thread Nuno Lucas
On Feb 20, 2008 11:06 AM, Michał Bartyzel <[EMAIL PROTECTED]> wrote: > Hi, > > I use the newest version of SQLite - 3.5.6. > I have 9 MB file with insert statements to ".read" into the data base. > When I run it under Linux it takes up to 20 minutes, but when I run it > under WndowsXP it takes abou

[sqlite] SQLite slow on WindowsXP

2008-02-20 Thread Michał Bartyzel
Hi, I use the newest version of SQLite - 3.5.6. I have 9 MB file with insert statements to ".read" into the data base. When I run it under Linux it takes up to 20 minutes, but when I run it under WndowsXP it takes about 2 hours! Does anybody know why? thanks for help mike -- Michał Bartyzel Pro

[sqlite] bit operations in select statements

2008-02-20 Thread Jos van den Oever
Hi all, Is it possible to use logic operations on fields, in particular on integers and on fixed sized blobs (256 bits/32 bytes). I'd like to do queries like this: select key where number_of_bits_set(value) = 10; or select key where value & '01011'; What would be a good method of implem

Re: [sqlite] Easy question concerning C++ & sqlite3

2008-02-20 Thread vl.pavlov
hi again, i wander in this expression: * table words * * word | number * insert or replace into words values(bla', coalesce((select count(number) from words where word = bla)+1, 1)); there is expression: select count(number) from words where word = bla

Re: [sqlite] Easy question concerning C++ & sqlite3

2008-02-20 Thread vl.pavlov
hello again & thx 4 reply i'll try with this. i am very new 2 sql and sqlite so i would like 2 find the fastest way to do the operation i explained in the first post thank you once more Dennis Cote wrote: > > vl.pavlov wrote: >> >> C++ aplication should put words into sqlite3 database, but i

Re: [sqlite] Please test lastest CVS using WinCE

2008-02-20 Thread noel frankinet
[EMAIL PROTECTED] a écrit : > Can somebody with the ability to compile and test for wince > please test check-in [4802] for me. > >http://www.sqlite.org/cvstrac/chngview?cn=4802 > > For that matter, is there anybody out there who would like > to become the official wince maintainer for SQLite?

[sqlite] Database Question

2008-02-20 Thread Jay Young
I am using a sqlite3 database in a pda application that i am writing, the reason i am using it is so when our employees are out in the field collecting data the application can do data checking in the field to make sure the data the field personel are checking exist back in the main database in the