[sqlite] [BUG; 3.7.13] ANALYZE leads to a wrong query plan for RTrees

2013-12-09 Thread skywind mailing lists
This is an example that the ANALYZE command leads to a wrong query plan for RTrees: CREATE TABLE A (ID INTEGER PRIMARY KEY, Latitude, Longitude, Altitude); CREATE VIRTUAL TABLE B USING RTree (ID, FromLatitude, TillLatitude, FromLongitude,TillLongitude); INSERT INTO A VALUES(1,0,0,0); INSERT INTO

Re: [sqlite] SQLite version 3.8.2 running 2.5x faster for some queries.

2013-12-09 Thread Petite Abeille
On Dec 9, 2013, at 8:01 PM, Warren Young wrote: >> I remember reading an essay by a user of controlled substances > > Your next reading assignment is a book[3] on a functional programming > language, So… do you make your functions wear a purity ring? To keep them, hmmm, chaste? __

Re: [sqlite] RTrees and query speed

2013-12-09 Thread skywind mailing lists
Am 09.12.2013 um 10:06 schrieb Clemens Ladisch : > skywind mailing lists wrote: >> Assume I have the following tables: >> >> CREATE TABLE A (ID INTEGER PRIMARY KEY, Latitude, Longitude, Altitude); >> CREATE VIRTUAL TABLE B USING RTree (ID, FromLatitude, TillLatitude, >> FromLongitude,TillLongit

Re: [sqlite] "Last Modified" file attribute is not updated

2013-12-09 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/12/13 10:30, Felipe Farinon wrote: > I'm sorry to repost, but I just want to confirm that there is no > interest in fixing this, so that I can handle this with a workaround in > my application. Note that the effect will be to make SQLite slower

Re: [sqlite] SQLite version 3.8.2 running 2.5x faster for some queries.

2013-12-09 Thread Warren Young
On 12/7/2013 12:53, James K. Lowden wrote: On Thu, 05 Dec 2013 17:52:47 -0700 Warren Young wrote: To prove my point, I decided to divide the SQLite commands[1] into those that modify the DB and those that do not: Oh, let me help you out here: these aren't functions. I was careful to call t

Re: [sqlite] "Last Modified" file attribute is not updated

2013-12-09 Thread Felipe Farinon
I'm sorry to repost, but I just want to confirm that there is no interest in fixing this, so that I can handle this with a workaround in my application. Em 04/12/2013 15:42, Felipe Farinon escreveu: I'm using Windows 7, sqlite 3.7.17 compiled with a VS 2010. When writing in a sqlite database

Re: [sqlite] sqlite download for 64 bit

2013-12-09 Thread j. merrill
Use the 32-bit DLL. If you use that, your application will run on both 32- and 64-bit versions of Windows. If you use the 64-bit DLL, it will only work on 64-bit versions of Windows. Krishna Chaitanya Konduru wrote > at the sqlite download page there is download for win 32 x86 what abut > 64bit o

Re: [sqlite] SQLite version 3.8.2 running 2.5x faster for some queries.

2013-12-09 Thread Warren Young
On 12/7/2013 12:15, James K. Lowden wrote: On Wed, 04 Dec 2013 12:04:07 -0700 Warren Young wrote: Determinism is a property of a function; there is no such thing as a function that is sometimes deterministic and sometimes not. databases are about as far from side-effect-free as you can get.

Re: [sqlite] SELECT statement failure

2013-12-09 Thread Simon Slavin
On 9 Dec 2013, at 4:12pm, RSmith wrote: > On 2013/12/09 15:32, Simon Slavin wrote: >> Second, multiplying by 100 and defining columns as INTEGER to store money to >> two places /is/ the correct solution. This means that arithmetic will >> automatically be done to two places. You will have to

Re: [sqlite] SELECT statement failure

2013-12-09 Thread RSmith
Thank you - I stand corrected - I should really stop quoting from memory! On this note, a technical question: The data surely is coerced when comparing to another column that has an affinity of not "NONE" or assigned collation, right? If so, what about a calculation, i.e the SQL phrase "WHERE

Re: [sqlite] SELECT statement failure

2013-12-09 Thread j . merrill
If floating-point data is involved (common when values are stored as dollars and cents, e.g. 2.79 for 2 dollars 79 cents) you cannot use "=" for a comparison like this, because of small differences caused by the lack of exact representation for many floating-point numbers. See http://en.wikiped

Re: [sqlite] SELECT statement failure

2013-12-09 Thread Richard Hipp
On Mon, Dec 9, 2013 at 11:12 AM, RSmith wrote: > > On 2013/12/09 15:32, Simon Slavin wrote: > >> First, never do this: >> >>> CREATE TABLE IF NOT EXISTS T1(F1,F2,F3,F4,SUBTOTAL); >>> >> Always define your column types. In your case you'd be using either >> INTEGER or REAL. >> > > Agreed, those C

Re: [sqlite] SELECT statement failure

2013-12-09 Thread RSmith
On 2013/12/09 15:32, Simon Slavin wrote: First, never do this: CREATE TABLE IF NOT EXISTS T1(F1,F2,F3,F4,SUBTOTAL); Always define your column types. In your case you'd be using either INTEGER or REAL. Agreed, those Columns have TEXT affinity by default which is wholly unsuitable for numeri

[sqlite] [ANNOUNCEMENT] Updated: sqlite3-3.8.2-2 for Cygwin/Cygwin64

2013-12-09 Thread Jan Nijtmans
SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine Changes since 3.8.1-1 = * Updated to upstream 3.8.2 release. Main features: * Added support for WITHOUT ROWID tables. * Extend the maximum path l

Re: [sqlite] sqlite download for 64 bit

2013-12-09 Thread RSmith
I think the OP might mean the DLL downloaded from the site - which is W32, I don't think this can be linked into a 64-bit application... can it? (I haven't attempted it). Would the powers that be terribly mind adding a 64-bit DLL to the download list? On 2013/12/09 16:24, Kees Nuyt wrote: On

Re: [sqlite] sqlite download for 64 bit

2013-12-09 Thread Kees Nuyt
On Mon, 9 Dec 2013 17:48:34 +0530, Krishna Chaitanya Konduru wrote: >hi >at the sqlite download page there is download for win 32 x86 what abut >64bit os.. would the same appllication runon both 32 and 64 bit os?? I am a >total newbie SQLite compiled for 32 bit works fine on 32-bit and 64-bit W

Re: [sqlite] SELECT statement failure

2013-12-09 Thread Simon Slavin
On 8 Dec 2013, at 10:21pm, MikeD wrote: > The simple solution is use INTEGER and multiple by .01, but > extremely interested in how to correctly process money with 2 decimal > positions. First, never do this: > CREATE TABLE IF NOT EXISTS T1(F1,F2,F3,F4,SUBTOTAL); Always define your column ty

Re: [sqlite] SELECT statement failure

2013-12-09 Thread MikeD
drop table if exists orders_tbl; create table if not exists orders_tbl(ord_total,discount,tax1,tax2,tax3,tax4,delivery_tax,delivery_fee,subtotal); insert into orders_tbl values(38.55, 0, 2.42, 0, 0, 0, .1, 1.5, 34.53); insert into orders_tbl values(3855, 0, 242, 0, 0, 0, 10, 150, 3453); select *,'

[sqlite] sqlite download for 64 bit

2013-12-09 Thread Krishna Chaitanya Konduru
hi at the sqlite download page there is download for win 32 x86 what abut 64bit os.. would the same appllication runon both 32 and 64 bit os?? I am a total newbie Regards Krishna ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080

Re: [sqlite] Application ID request

2013-12-09 Thread JamesWildDev
Thank you. From: Richard Hipp-3 [via SQLite] Sent: 08/12/2013 11:19 PM To: JamesWildDev Subject: Re: Application ID request On Sun, Dec 8, 2013 at 5:27 AM, JamesWildDev wrote: > Hello. > > I'm developing a small games engine in my spare time which stores all of

Re: [sqlite] SELECT statement failure

2013-12-09 Thread MikeD
Correction: USING REAL: DROP TABLE IF EXISTS T1; CREATE TABLE IF NOT EXISTS T1(F1,F2,F3,F4,SUBTOTAL); INSERT INTO T1 VALUES(38.55,2.42,.1,1.5,34.53); SELECT * FROM T1 WHERE ROUND(F1-F2-F3-F4,2)=SUBTOTAL; -- View this message in context: http://sqlite.1065341.n5.nabble.com/SELECT-statement-f

Re: [sqlite] SQLite_version

2013-12-09 Thread MikeD
This is how it is done in code: select sqlite_version() -- View this message in context: http://sqlite.1065341.n5.nabble.com/SQLite-version-tp72127p72830.html Sent from the SQLite mailing list archive at Nabble.com. ___ sqlite-users mailing list sqlit

Re: [sqlite] SELECT statement failure

2013-12-09 Thread MikeD
This will cause a rounding error so using INTEGER * .01 in second example. USING REAL: DROP TABLE IF EXISTS T1; CREATE TABLE IF NOT EXISTS T1(F1,F2,F3,F4,SUBTOTAL); INSERT INTO ORDERS_TBL VALUES(38.55,0,2.42,0,0,0,.1,1.5,34.53) SELECT * FROM orders_tbl WHERE ROUND(F1-F2-F3-F4,2)=SUBTOTAL; Using I

Re: [sqlite] RTrees and query speed

2013-12-09 Thread Clemens Ladisch
skywind mailing lists wrote: > Assume I have the following tables: > > CREATE TABLE A (ID INTEGER PRIMARY KEY, Latitude, Longitude, Altitude); > CREATE VIRTUAL TABLE B USING RTree (ID, FromLatitude, TillLatitude, > FromLongitude,TillLongitude); > > According to the RTree documentation this query s