Re: [sqlite] Find non-numeric character in text field

2009-11-04 Thread Jean-Christophe Deschamps
>I would like to do a where on a text field and check if the values have >non-numeric characters, >which is in this case is anything other than 1,2,3,4,5,6,7,8,9,0 or a >space >character. >Is this possible without using a UDF or a very long OR construction? select * from mytable where mycol

Re: [sqlite] Sqlite performnace problem on big project

2009-11-04 Thread D. Richard Hipp
On Nov 4, 2009, at 5:41 PM, Levent Serinol wrote: > >I wrote a new application four our company which will be used to > replace our maildir (file) based mail system into sqlite db files > for every user. Everything looks perfect except select queries on > big tables is slow. > > >

Re: [sqlite] Find non-numeric character in text field

2009-11-04 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 RB Smissaert wrote: > I would like to do a where on a text field and check if the values have > non-numeric characters, > which is in this case is anything other than 1,2,3,4,5,6,7,8,9,0 or a space > character. > Is this possible without using a UDF

[sqlite] Find non-numeric character in text field

2009-11-04 Thread RB Smissaert
I would like to do a where on a text field and check if the values have non-numeric characters, which is in this case is anything other than 1,2,3,4,5,6,7,8,9,0 or a space character. Is this possible without using a UDF or a very long OR construction? RBS

Re: [sqlite] FTS3 IGNORE OR REPLACE????

2009-11-04 Thread Scott Hess
fts3 columns are all implicitly TEXT, no matter how you dress them up. There's already docid as a primary-key alias for rowid. -scott On Wed, Nov 4, 2009 at 11:03 AM, Simon Slavin wrote: > > On 4 Nov 2009, at 5:05pm, sorka wrote: > >> Hmm. Have you actually tried this

[sqlite] SQLite version 3.6.20

2009-11-04 Thread D. Richard Hipp
SQLite version 3.6.20 is now available on the SQLite website. http://www.sqlite.org/ Version 3.6.20 is a monthly maintenance release. There are some improvements to the query planner that help in cases where the right- hand side of a LIKE or GLOB operator is a host parameter (such as ? or

Re: [sqlite] FTS3 IGNORE OR REPLACE????

2009-11-04 Thread sorka
There have been past discussions asking the same thing and various sqlite developers saying I'll check and reporting back that FTS3 doesn't implement replace or ignore. I was hoping someone had come up with a work around solution since then that doesn't have a big performance penalty. Simon

Re: [sqlite] FTS3 IGNORE OR REPLACE????

2009-11-04 Thread Simon Slavin
On 4 Nov 2009, at 5:05pm, sorka wrote: > Hmm. Have you actually tried this yourself? > > Here's what I get with a simplified example: > > CREATE VIRTUAL TABLE keyword using FTS3(programId INTEGER PRIMARY KEY, > title); > INSERT OR IGNORE INTO keyword (programId, title) VALUES(3, "A"); > INSERT

[sqlite] Fwd: How to Custom Sqlite for Vxwors

2009-11-04 Thread D. Richard Hipp
Begin forwarded message: > From: fang_tian91 > Date: November 4, 2009 10:20:50 AM EST > To: sqlite > Subject: How to Custom Sqlite for Vxwors > > > Dear all : > > SQlite is a very good DataBase , I have test it on > Windows ,But now I want

Re: [sqlite] FTS3 IGNORE OR REPLACE????

2009-11-04 Thread sorka
Hmm. Have you actually tried this yourself? Here's what I get with a simplified example: CREATE VIRTUAL TABLE keyword using FTS3(programId INTEGER PRIMARY KEY, title); INSERT OR IGNORE INTO keyword (programId, title) VALUES(3, "A"); INSERT OR IGNORE INTO keyword (programId, title) VALUES(3,

Re: [sqlite] Locking bug?

2009-11-04 Thread O'Neill, Owen
I could be wrong, but even if the statement failed, and you have called finalize, I vaguely recollect reading somewhere that (if you called BEGIN) then you need to rollback. Can't find the manual / wiki link to back that up at the moment. (oh and installing a busy handler should help things -

Re: [sqlite] Locking bug?

2009-11-04 Thread Jay A. Kreibich
On Wed, Nov 04, 2009 at 05:19:11PM +0100, Nico Coesel scratched on the wall: > > > > I'm using the sqlite3_exec function to execute a query; this function > > > calls slite3_finalize at the end so this should release the locks. > > Yes, I check every return value. I also see errors from process

Re: [sqlite] Table within a table??

2009-11-04 Thread CityDev
Darren Duncan wrote: > > Being that arrays *are* relations, you can use all the relational > operators on them. > Just to be totally clear - an array is not a relation. An array has fixed order of each dimension (eg columns and rows), and you address it by position. A relation is

Re: [sqlite] Locking bug?

2009-11-04 Thread Nico Coesel
> -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Simon Slavin > Sent: woensdag 4 november 2009 16:09 > To: General Discussion of SQLite Database > Subject: Re: [sqlite] Locking bug? > > > On 4 Nov 2009, at 1:17pm, Nico

Re: [sqlite] FTS3 IGNORE OR REPLACE????

2009-11-04 Thread Scott Hess
Think you're going to have to post an example of how to replicate it, then. A really good way to demonstrate is using self-contained code (the tcl bindings are great for this kind of thing). Your description doesn't match my experience with fts3, so obviously either you're doing something

Re: [sqlite] SQLite on PocketBook

2009-11-04 Thread Beau Wilkinson
> Correct, ARM's emulate hardware floating point using software. That doesn't really say anything about compliance with standards/ From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] On Behalf Of O'Neill, Owen

Re: [sqlite] SQLite on PocketBook

2009-11-04 Thread Beau Wilkinson
>I'm guessing that your hardward does not implement IEEE 754 floating >point correctly. We've seen that sort of thing before, especially >with GCC. There are some options to GCC (which escape my memory right >now) that can force it to use strict IEEE 754 floating point rather >than its

Re: [sqlite] SQLite on PocketBook

2009-11-04 Thread O'Neill, Owen
Correct, ARM's emulate hardware floating point using software. And it's really slow too since it forces a context switch as the processor spots it's been given a FP operation to do and has to jump into the fp emulation. If you are lucky enough to have control over it & depending on the level of

Re: [sqlite] FTS3 IGNORE OR REPLACE????

2009-11-04 Thread sorka
I'm doing both delete and insert within the same transaction already. The problem is there will alway be a few duplicates out of the hundreds of records so it will always fail. For whatever reason, the delete, even though it's just 2 or 3 records is taking 10 times longer than just the insert

Re: [sqlite] SQLite on PocketBook

2009-11-04 Thread D. Richard Hipp
On Nov 4, 2009, at 4:53 AM, Alexander Drozd wrote: > > My name is Alexander. I am working on an open-source spaced- > repetition software project (http://code.google.com/p/pbanki/). My > software relies on SQLite library. I came across some bug-like > problems with running SQLite on a

Re: [sqlite] FTS3 IGNORE OR REPLACE????

2009-11-04 Thread Scott Hess
On Tue, Nov 3, 2009 at 9:12 PM, sorka wrote: > Is there any way to have an intsert into an FTS3 table ignore a row if the > ROWID being inserted already exists? This is turning out to be quite > troublesome because I'm inserting thousands of records where just a few like > 3

Re: [sqlite] Locking bug?

2009-11-04 Thread Simon Slavin
On 4 Nov 2009, at 1:17pm, Nico Coesel wrote: > Two seperate processes (process A and process B) on a Linux system > read > and write to the same database. Process A performs a transaction > every 5 > seconds. Every now and then the locks from process A are not released > (judging from

Re: [sqlite] Storing 3-byte ints efficiently

2009-11-04 Thread O'Neill, Owen
I'm not the expert on this, but there is an overhead to consider in terms of the record header. http://www.sqlite.org/fileformat.html one question - the table storing the integers - was it created with one of the data values as the primary key ? If not then you'll have a rowid in each row too.

[sqlite] Storing 3-byte ints efficiently

2009-11-04 Thread Kelly Jones
I imported a file with ~16.8M rows of 2 integers each (~33.6M ints total) into an SQLite db, no indexes. The ints are all < 16777216 (3 bytes) At 3 bytes/int, I thought the resulting db would be ~100M in size (plus some overhead), but it was actually 274M. How do I make sqlite3 store ints

Re: [sqlite] in-memory database concept

2009-11-04 Thread O'Neill, Owen
If that's really what you want to do then I think something along the lines of keeping the DB in the C++ program and then using a named pipe or socket to do the inter-processes communication between the java and C++ programs is the way to go. - or some CORBA/SOAP like wrapper to do the remote

Re: [sqlite] User-defined infix functions

2009-11-04 Thread Jay A. Kreibich
On Wed, Nov 04, 2009 at 01:50:40AM +0100, Jean-Christophe Deschamps scratched on the wall: > Is it currently possible to specify that a user-defined function is of > type infix, using the extension framework? No. > Would it be possible to have this feature someday, possibly as an > optional

Re: [sqlite] what sort of programming errors would cause these strange results

2009-11-04 Thread Tim Romano
I haven't gotten my daily digest yet from the SQLITE-USERS group, and don't know if there have been responses to my request for help sent yesterday, but I wanted to report that I have found the cause of the errors in the library I'm using. The library is treating SQLite PK columns of INT

Re: [sqlite] index optimal?

2009-11-04 Thread Sylvain Pointeau
it could be very nice to have a tool going through a bunch of queries, giving all the optimal indices... nothing to do with a brain, it is something that can be produced automatically. the final decision on to create them or not is belong to the implementer (the brain) I know that I would be

[sqlite] Locking bug?

2009-11-04 Thread Nico Coesel
Hello, I have the following situation: Two seperate processes (process A and process B) on a Linux system read and write to the same database. Process A performs a transaction every 5 seconds. Every now and then the locks from process A are not released (judging from /proc/locks). It seems this

Re: [sqlite] in-memory database concept

2009-11-04 Thread Serdar Genc
Yes I am aware of that but I need to access an in-memory database from two processes which were written in Java and C++. I am just looking for a way to do so.. On Wed, Nov 4, 2009 at 2:50 PM, Jay A. Kreibich wrote: > On Wed, Nov 04, 2009 at 10:27:57AM +0200, Serdar Genc

Re: [sqlite] in-memory database concept

2009-11-04 Thread Jay A. Kreibich
On Wed, Nov 04, 2009 at 10:27:57AM +0200, Serdar Genc scratched on the wall: > But when I try to do this for in-memory, everything is getting chunky. A new > database is being created in memory for every attempt to open > database in memory. Now I am trying to switch the database handler between

Re: [sqlite] FTS3 IGNORE OR REPLACE????

2009-11-04 Thread Simon Slavin
On 4 Nov 2009, at 5:12am, sorka wrote: > Is there any way to have an intsert into an FTS3 table ignore a row > if the > ROWID being inserted already exists? First, make whatever column you're using for ROWID explicit, not implicit. Declare one of your own named columns as INTEGER PRIMARY

Re: [sqlite] in-memory database concept

2009-11-04 Thread Serdar Genc
I also tried it.. The result is just like the same with /tmp Total time to insert 100.000 data into database: ramdisk: 69860 ms memory: 9606 ms Serdar On Wed, Nov 4, 2009 at 12:14 PM, Abel, John wrote: > Hi Serdar, > > For Solaris, you need: > >ramdiskadm -a

Re: [sqlite] in-memory database concept

2009-11-04 Thread Abel, John
Hi Serdar, For Solaris, you need: ramdiskadm -a mydisk 2m newfs /dev/rramdisk/mydisk mkdir /mnt/ramDisk mount /dev/ramdisk/mydisk /mnt/ramDisk John -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf

Re: [sqlite] in-memory database concept

2009-11-04 Thread Serdar Genc
Yes you are right about it but when I tried to mount a place as tmpfs, its type seemed swap just like /tmp. The speed seems to be same with /tmp. What I need to increase the speed for /tmp or another solution for in-memory database. Serdar On Wed, Nov 4, 2009 at 10:56 AM, Stephan Wehner

Re: [sqlite] in-memory database concept

2009-11-04 Thread Stephan Wehner
On Wed, Nov 4, 2009 at 12:51 AM, Serdar Genc wrote: > The OS that I am implementing this is SunOS and I have already tried doing > it by creating the file in /tmp but > but because of file I/O operations to reach /tmp. The speed of sqlite is > significantly slow (memory is

Re: [sqlite] in-memory database concept

2009-11-04 Thread Serdar Genc
The OS that I am implementing this is SunOS and I have already tried doing it by creating the file in /tmp but but because of file I/O operations to reach /tmp. The speed of sqlite is significantly slow (memory is 5 times faster than file system). Speed of Sqlite is important for me. That's why I

Re: [sqlite] in-memory database concept

2009-11-04 Thread Stephan Wehner
On Wed, Nov 4, 2009 at 12:27 AM, Serdar Genc wrote: > Hello everyone, > > I have a little bit problem about in-memory database feature of SQLite. I > would like to use two programming languages in my application . > These languages will be Java and C++. I would like to

[sqlite] in-memory database concept

2009-11-04 Thread Serdar Genc
Hello everyone, I have a little bit problem about in-memory database feature of SQLite. I would like to use two programming languages in my application . These languages will be Java and C++. I would like to reach the same database in memory by using both. I used Xerial for JDBC for Java.