Re: [sqlite] Regarding CoC

2018-10-25 Thread Philip Warner
On 25/10/2018 9:59 PM, Mike King wrote: I’m a good atheist but I love the CoC. Not bothered by the religious bits but I get the sentiment. I guess it appeals to my British sense of irony and odd sense of humour :) I agree with the humour. As a satirical statement on the horrors of building a

Re: [sqlite] Optmize queries on ranges

2018-10-25 Thread Keith Medcalf
--- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. On Thursday, 25 October, 2018 10:48, Dan Kennedy wrote: >On 10/25/2018 11:13 PM, siscia wrote: >> >> I am facing an interesting optimization problem. >> >> I have a table l

Re: [sqlite] Optmize queries on ranges

2018-10-25 Thread Keith Medcalf
On Thursday, 25 October, 2018 10:48, Dan Kennedy wrote: >On 10/25/2018 11:13 PM, siscia wrote: >> Hi all, >> CREATE TABLE ranges ( >> start int, >> end int, >> value int, >> ); >> The query that I am interested in optimizing is "select value from >> ranges where (? between start a

Re: [sqlite] Optmize queries on ranges

2018-10-25 Thread Simon Slavin
On 25 Oct 2018, at 5:13pm, siscia wrote: > CREATE TABLE ranges ( >start int, >end int, >value int, > ); > > The query that I am interested in optimizing is > "select value from ranges > where (? between start and end)" First, "END" is a reserved keyword in SQLite. Your use of i

Re: [sqlite] Optmize queries on ranges

2018-10-25 Thread Dan Kennedy
On 10/25/2018 11:13 PM, siscia wrote: Hi all, I am facing an interesting optimization problem. I have a table like this: CREATE TABLE ranges ( start int, end int, value int, ); The query that I am interested in optimizing is "select value from ranges where (? between start and end

[sqlite] Allow inclusion of generate_series function

2018-10-25 Thread Nathan Green
Hi, According to the online documentation (https://www.sqlite.org/series.html), generate_series is compiled into the command line shell. As it turns out, this is not so. It is not even an option in the build system from what I can tell. It would be nice to at least have a build flag to enable it.

[sqlite] Optmize queries on ranges

2018-10-25 Thread siscia
Hi all, I am facing an interesting optimization problem. I have a table like this: CREATE TABLE ranges ( start int, end int, value int, ); The query that I am interested in optimizing is "select value from ranges where (? between start and end)" The max performance that I was able

Re: [sqlite] Invalid results on join and duplicate where clause (in-memory db only)

2018-10-25 Thread Richard Hipp
A preliminary fix for this problem is here: https://www.sqlite.org/src/info/5d5b596f152bb278 I have more testing and analysis to do before I close the ticket, but my current belief is that this is the correct fix. I don't know yet whether or not this justifies a patched 3.25.3 release. Seba

Re: [sqlite] Invalid results on join and duplicate where clause (in-memory db only)

2018-10-25 Thread Richard Hipp
On 10/25/18, R Smith wrote: > > CREATE TABLE x(a, b, c); > CREATE TABLE y(a, b); > INSERT INTO x VALUES (1, 0, 1); > INSERT INTO y VALUES (1, 2); > > SELECT x.a FROM x JOIN y ON x.c = y.a WHERE x.b = 1 AND x.b = 1; It also starts working if you remove the redundant x.b=1 constraint: SELECT x.a

Re: [sqlite] Invalid results on join and duplicate where clause (in-memory db only)

2018-10-25 Thread R Smith
In case it helps... This problem can be distilled to simply: CREATE TABLE x(a, b, c); CREATE TABLE y(a, b); INSERT INTO x VALUES (1, 0, 1); INSERT INTO y VALUES (1, 2); SELECT x.a FROM x JOIN y ON x.c = y.a WHERE x.b = 1 AND x.b = 1;   --   a   --   --   1 (Not excpected)

Re: [sqlite] Invalid results on join and duplicate where clause (in-memory db only)

2018-10-25 Thread Richard Hipp
On 10/25/18, Sebastian Zwack wrote: > Hi, > > when performing a simple join and duplicating the where clause I get invalid > rows back. Thanks for the bug report and test case. The ticket for this issue is here: https://www.sqlite.org/src/tktview/cf5ed20fc8621b165 > > SQLite version 3.25.2 > >

Re: [sqlite] Regarding CoC

2018-10-25 Thread Petite Abeille
> On Oct 25, 2018, at 1:20 PM, Mike King wrote: > > I’m more a Mr Creosote kind of guy. Wafer thin mint anybody? :) Please bring your own bucket. This is SQL*lite*. :P ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailing

Re: [sqlite] Regarding CoC

2018-10-25 Thread Mike King
I’m more a Mr Creosote kind of guy. Wafer thin mint anybody? :) On Thu, 25 Oct 2018 at 12:08, Petite Abeille wrote: > > > > On Oct 25, 2018, at 12:59 PM, Mike King wrote: > > > > The beer is bloody good and very strong. > > "Beer is proof that God loves us and wants us to be happy." > — Benjami

[sqlite] Invalid results on join and duplicate where clause (in-memory db only)

2018-10-25 Thread Sebastian Zwack
Hi, when performing a simple join and duplicating the where clause I get invalid rows back. SQLite version 3.25.2 CREATE TABLE user ( id INTEGER NOT NULL, active INTEGER NOT NULL, account INTEGER, PRIMARY KEY(id) ); CREATE TABLE account ( id INTEGER NOT NULL, name TEXT, PRIMARY KEY(id) ); INSE

Re: [sqlite] Regarding CoC

2018-10-25 Thread Petite Abeille
> On Oct 25, 2018, at 12:59 PM, Mike King wrote: > > The beer is bloody good and very strong. "Beer is proof that God loves us and wants us to be happy." — Benjamin Franklin, allegedly https://quoteinvestigator.com/2016/06/24/beer-wine/ > Also, I’m happy to report I didn’t go up in flames wh

Re: [sqlite] Regarding CoC

2018-10-25 Thread Mike King
I’m a good atheist but I love the CoC. Not bothered by the religious bits but I get the sentiment. I guess it appeals to my British sense of irony and odd sense of humour :) As for the Trappist beer our local Monastery (St Bernards, Whitwick) has just started the first trappist brewery in the uk.

Re: [sqlite] Regarding CoC

2018-10-25 Thread Petite Abeille
> On Oct 25, 2018, at 8:33 AM, Philip Warner wrote: > >> The second exhortation tells us that that's not enough, and we also have a >> duty to maximise pleasure. > > lol, good point. Quite the opposite of monkish orders. And yet… https://en.wikipedia.org/wiki/Trappist_beer Let SQLite be t