[sqlite] Will Bitwise Operations Use an Index?

2009-10-09 Thread Daniel Wickes
I'm trying to optimise some of my queries, and I would like to know if bitwise operators in terms will still use an index, or if I should be thinking about moving the more important values to separate columns that could be checked for equality. At the moment, I have an index created much like:

[sqlite] BUG: The difference between working tclsqlite in tclsh shell and from tcl script

2009-10-09 Thread Alexey Pechnikov
Hello! See the test: $ cat /tmp/test package require sqlite3 sqlite3 db :memory: db eval {create table test(a int);insert into test values (1);} proc test {label sql result} { global i j puts -nonewline $label\t set _result [db eval $sql] if { $_result

Re: [sqlite] building permanently loaded extensions

2009-10-09 Thread Alexey Pechnikov
Hello! On Thursday 17 September 2009 07:25:33 P Kishor wrote: pursuant to a recent email, I am wondering if I can build extension-functions.c http://www.sqlite.org/contrib/download/extension-functions.c?get=25 so that it is permanently available within sqlite library, and not just when

Re: [sqlite] New open source data synchronization tool

2009-10-09 Thread Jean-Denis Muys
On 10/9/09 10:54 , Cjkalbente jkalbe...@yahoo.com wrote: If you need an ETL open source program, best thing is to check Talend Open Studio. It is a practical and easily learnable program for ETL, data migration and synchronization. The bug reporting, the community and the forum are active.

Re: [sqlite] New open source data synchronization tool

2009-10-09 Thread Cjkalbente
Try it on a PC if you can one day! It is a powerful solution even though it is free and open source. Quality, to me, is good. Jean-Denis Muys-2 wrote: On 10/9/09 10:54 , Cjkalbente jkalbe...@yahoo.com wrote: If you need an ETL open source program, best thing is to check Talend Open

Re: [sqlite] Will Bitwise Operations Use an Index?

2009-10-09 Thread Daniel Wickes
Roger Binns wrote: SQLite provides you the tools to find out for yourself. In the shell do '.explain' and then give it your query prefixed with 'EXPLAIN'. You'll get the virtual db engine code for the query printed out. ... In answer to your question, yes the index is used. You can see

Re: [sqlite] Datetime mystery

2009-10-09 Thread Peter van Dijk
On Oct 8, 2009, at 16:16 , Jay A. Kreibich wrote: On Thu, Oct 08, 2009 at 08:29:10AM +0200, Fredrik Karlsson scratched on the wall: Yes, that would have been my guess too, but I am on CET, which I understand is UTC+1. CET is CEST in summer, which is UTC+2 Cheers, Peter

[sqlite] create virtual table if not exists

2009-10-09 Thread cefbear
Hey there, this has already been requested over two years ago (2007-08-30), but the ticket (#2604) is still pending: http://www.sqlite.org/cvstrac/tktview?tn=2604 The patch by Scott Hess (2008-08-28) looks sane - should be no problem to apply. Without this statement, I have to check

Re: [sqlite] Will Bitwise Operations Use an Index?

2009-10-09 Thread Pavel Ivanov
In answer to your question, yes the index is used. You can see instructions prefixed by Idx that aren't there when the index doesn't exist. I just want to warn you: the index is used but not for finding appropriate value of col_c (as your question seem to imply). It is used only to find

Re: [sqlite] Will Bitwise Operations Use an Index?

2009-10-09 Thread Michal Seliga
Daniel Wickes wrote: I'm trying to optimise some of my queries, and I would like to know if bitwise operators in terms will still use an index, or if I should be thinking about moving the more important values to separate columns that could be checked for equality. At the moment, I have

Re: [sqlite] Will Bitwise Operations Use an Index?

2009-10-09 Thread Pavel Ivanov
change your query a bit when you use bitwise operations, in your case when you have 'AND col_c32' you may add 'AND col_c=32'. now index will be used col_c = 64 does pass second condition and doesn't pass first one. ;-) Bitwise operators cannot be changed so easily to inequalities. Pavel

Re: [sqlite] Will Bitwise Operations Use an Index?

2009-10-09 Thread Michal Seliga
Pavel Ivanov wrote: change your query a bit when you use bitwise operations, in your case when you have 'AND col_c32' you may add 'AND col_c=32'. now index will be used col_c = 64 does pass second condition and doesn't pass first one. ;-) Bitwise operators cannot be changed so easily to

Re: [sqlite] Will Bitwise Operations Use an Index?

2009-10-09 Thread Pavel Ivanov
i didn't said this condition should be *replaced* , i said that inequality should be *added*. then index could limit resultset, but bitwise operator will still be used, only on hopefully smaller set of data Oh, sorry, I didn't understand you correctly then. But I believe that this condition

[sqlite] Table aliases

2009-10-09 Thread Shaun Seckman (Firaxis)
Happy Friday everyone! I've got several tables each representing a specific language which my application uses to access translated strings. It'd be extremely useful if I were able to alias a table as CurrentLanguage as opposed to directly referencing the actual name. This saves

Re: [sqlite] Table aliases

2009-10-09 Thread Martin Engelschalk
Hi, yes, creating a table will duplicate your data. However, a view will not: create view CurrentLanguage as select * from SomeLanguage; see http://www.sqlite.org/lang_createview.html Martin Shaun Seckman (Firaxis) wrote: Happy Friday everyone! I've got several tables each

Re: [sqlite] Table aliases

2009-10-09 Thread BareFeet
Hi Shaun, It'd be extremely useful if I were able to alias a table as CurrentLanguage as opposed to directly referencing the actual name. This saves me from having to tweak my lookup statements on the fly to change the table name being accessed. Is it possible to perform such an

Re: [sqlite] Table aliases

2009-10-09 Thread Wes Freeman
I agree with Tom. With the proper indexes a single table for all languages is the way to go. I don't think a view for each language is necessary--just make a function that takes language and whatever you use to look up the localized strings, and returns the localized string. Further, there are

Re: [sqlite] SQLite database on a certain high-performance SSD

2009-10-09 Thread Mark
It's an ioDrive. We updated the firmware to the just-released version, and it made a WORLD of difference. It's now performing at the level we'd expect (which is quite impressive!) Talking with their performance engineer, they do indeed suggest disabling the OS cache in some cases. We haven't

[sqlite] rtree's rounding some integer values but not others.

2009-10-09 Thread George Hartzell
I've reduced a problem that I'm having to the following test case. I insert two rows into an rtree table. In the first case when I select chromStart and chromEnd I get the same values as I inserted. In the second case the chromEnd is 1 greater than what I inserted. In the third case chromStart

[sqlite] FTS3 performance oddity

2009-10-09 Thread Mark
I have a database containing a single table, with FTS3: create virtual table my_fts_table using fts3 ( last_name text not null, first_name text not null, middle_name text not null, identifiers text not null, address_1 text not null, city

Re: [sqlite] A rowid request

2009-10-09 Thread D . Richard Hipp
On Oct 9, 2009, at 9:02 AM, Marco Bambini wrote: Hello Dr. Hipp, I understand that you are probably against this request but I really would like to have a way to automatically retrieve the rowid column from a select statement without the needs to manually add the rowid column to the

Re: [sqlite] rtree's rounding some integer values but not others.

2009-10-09 Thread Jay A. Kreibich
On Fri, Oct 09, 2009 at 10:50:49AM -0700, George Hartzell scratched on the wall: It seems odd. Are the values large enought that they're causing problems with the 32-bit floats? Yes. 32-bit IEEE 754 floats offer 23+1 bits of precision, which translates to about 7.2 base-10 digits. Those

Re: [sqlite] FTS3 performance oddity

2009-10-09 Thread Scott Hess
Your analysis is correct. One way this is often fixed in full-text-search systems is to keep index stats so that the more specific bits of the query can come first. In this case, nicky AND nigel gives you a small enough result set that it would be more efficient to scan the matched documents for

Re: [sqlite] rtree's rounding some integer values but not others.

2009-10-09 Thread George Hartzell
George Hartzell writes: I've reduced a problem that I'm having to the following test case. I insert two rows into an rtree table. In the first case when I select chromStart and chromEnd I get the same values as I inserted. In the second case the chromEnd is 1 greater than what I

[sqlite] Need Help SQL

2009-10-09 Thread Rick Ratchford
I'm trying to correctly word an SQL statement. Data Fields: ID, Date, Month, Day, Year, Price Problem: When provided the starting Month/Day numbers, and ending Month/Day numbers, what is the correct way to SQL the database so that the recordset created returns as follows (assume 4 years of

[sqlite] Wiki consisting of rows in a db table

2009-10-09 Thread Kelly Jones
Consider a wiki that lets you edit rows in a db table. Each page is a row in the table, and has fields that anyone can edit. Like all wikis, it keeps a history of edits (including who made the edits), and lets you revert an edit, or even delete a row (page) completely. Has anyone implemented

Re: [sqlite] Need Help SQL

2009-10-09 Thread Igor Tandetnik
Rick Ratchford r...@amazingaccuracy.com Data Fields: ID, Date, Month, Day, Year, Price Problem: When provided the starting Month/Day numbers, and ending Month/Day numbers, what is the correct way to SQL the database so that the recordset created returns as follows (assume 4 years of data):

Re: [sqlite] Need Help SQL

2009-10-09 Thread Rick Ratchford
Thank you Igor. I will. :-) Cheers! Rick #-Original Message- #From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- #boun...@sqlite.org] On Behalf Of Igor Tandetnik #Sent: Friday, October 09, 2009 6:46 PM #To: sqlite-users@sqlite.org #Subject: Re: [sqlite] Need Help SQL # #Rick