Re: [sqlite] What is the C language standard to which sqlite conforms ?

2019-11-20 Thread Richard Hipp
On 11/19/19, Dennis Clarke wrote: > > CC=/opt/bw/gcc9/bin/gcc > > CFLAGS=-std=iso9899:1999 -O0 -m64 -g -march=k8 -mtune=k8 \ > -Wl,-rpath=/opt/bw/lib,--enable-new-dtags -fno-builtin \ > -malign-double -mpc80 > > CPPFLAGS=-I/opt/bw/include -D_POSIX_PTHREAD_SEMANTICS \ > -D_LARGEFILE64_SOURCE

Re: [sqlite] What is the C language standard to which sqlite conforms ?

2019-11-20 Thread Richard Hipp
On 11/20/19, Dennis Clarke wrote: > > However the tests fail repeatedly with a code dump : > Unable to reproduce the problem. What do you get when you run: ./testfixture test/walvfs.test What version of TCL are you linking against? For casual observers, please note that the segfault is

Re: [sqlite] When to use nested transaction?

2019-11-20 Thread Amirouche Boubekki
Le lun. 18 nov. 2019 à 20:37, Amirouche Boubekki a écrit : > > I am looking for use-cases for nested transactions. When are nested > transactions useful in a single writer context? I am thinking about nested transaction in Sqlite LSM extensions. In what occasion, a nested transaction will

Re: [sqlite] Optimising query with aggregate in subselect.

2019-11-20 Thread Merijn Verstraaten
> On 20 Nov 2019, at 20:37, Andy Bennett wrote: > > Hi, > >> Did you try retrieving the data "directly" or do you need the subselect in >> order to maintain compatibility with other SQL dialects that are no longer >> able to retrieve data from the row on which the max was found? > > Thanks

Re: [sqlite] Optimising query with aggregate in subselect.

2019-11-20 Thread David Raymond
"There's a small sidenote (that I'm too lazy too find right now) in the select docs that mentions that, in case of using min or max as aggregate, the non-aggregate columns will come from the row that held the min/max value." Look in https://www.sqlite.org/quirks.html under "6. Aggregate

Re: [sqlite] Optimising query with aggregate in subselect.

2019-11-20 Thread Keith Medcalf
Yes. See under item #3 in the Side note on https://sqlite.org/lang_select.html Special processing occurs when the aggregate function is either min() or max(). Example: SELECT a, b, max(c) FROM tab1 GROUP BY a; When the min() or max() aggregate functions are used in an aggregate query,

Re: [sqlite] What is the C language standard to which sqlite conforms ?

2019-11-20 Thread Dennis Clarke
On 11/20/19 12:12 PM, Richard Hipp wrote: On 11/19/19, Dennis Clarke wrote: CC=/opt/bw/gcc9/bin/gcc CFLAGS=-std=iso9899:1999 -O0 -m64 -g -march=k8 -mtune=k8 \ -Wl,-rpath=/opt/bw/lib,--enable-new-dtags -fno-builtin \ -malign-double -mpc80 CPPFLAGS=-I/opt/bw/include -D_POSIX_PTHREAD_SEMANTICS

Re: [sqlite] Optimising query with aggregate in subselect.

2019-11-20 Thread Simon Slavin
On 20 Nov 2019, at 6:11pm, Andy Bennett wrote: > In past attempts at improving query performance these have been added to > encourage it to use an index that it can do a SCAN thru' rather than the > table that it would need to do a SEARCH thru'. SQLite is not using the PRIMARY INDEX to

Re: [sqlite] Optimising query with aggregate in subselect.

2019-11-20 Thread Keith Medcalf
Did you try retrieving the data "directly" or do you need the subselect in order to maintain compatibility with other SQL dialects that are no longer able to retrieve data from the row on which the max was found? CREATE TABLE entrys ( logid INTEGER NOT NULL, entrynumber INTEGER

Re: [sqlite] Optimising query with aggregate in subselect.

2019-11-20 Thread Andy Bennett
Hi, In past attempts at improving query performance these have been added to encourage it to use an index that it can do a SCAN thru' rather than the table that it would need to do a SEARCH thru'. SQLite is not using the PRIMARY INDEX to immediately locate the appropriate row, but is

Re: [sqlite] Optimising query with aggregate in subselect.

2019-11-20 Thread Simon Slavin
On 20 Nov 2019, at 4:49pm, Andy Bennett wrote: > INNER JOIN "entrys" > ON > 1 = "entrys"."log-id" AND > "specific-entrys"."key" = "entrys"."key" AND > "user" = "entrys"."region" AND > "specific-entrys"."entry-number" = "entrys"."entry-number" > AND "entrys"."key" > "G" I can't solve your

Re: [sqlite] Optimising query with aggregate in subselect.

2019-11-20 Thread Andy Bennett
Hi, INNER JOIN "entrys" ON 1 = "entrys"."log-id" AND "specific-entrys"."key" = "entrys"."key" AND "user" = "entrys"."region" AND "specific-entrys"."entry-number" = "entrys"."entry-number" AND "entrys"."key" > "G" I can't solve your problem, but the PRIMARY KEY for "entrys" is ("log-id",

Re: [sqlite] Optimising query with aggregate in subselect.

2019-11-20 Thread Andy Bennett
Hi, Did you try retrieving the data "directly" or do you need the subselect in order to maintain compatibility with other SQL dialects that are no longer able to retrieve data from the row on which the max was found? Thanks Keith! I understood that selecting other columns during an

Re: [sqlite] What is the C language standard to which sqlite conforms ?

2019-11-20 Thread Dennis Clarke
On 11/20/19 1:04 PM, Richard Hipp wrote: On 11/20/19, Dennis Clarke wrote: However the tests fail repeatedly with a code dump : Unable to reproduce the problem. What do you get when you run: ./testfixture test/walvfs.test What version of TCL are you linking against? For casual

Re: [sqlite] What is the C language standard to which sqlite conforms ?

2019-11-20 Thread Richard Hipp
On 11/20/19, Dennis Clarke wrote: > > In any case feels like a real problem. I am unable to reproduce the problem here. Can you run it under valgrind to see if that provides any other clues? -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing

Re: [sqlite] What is the C language standard to which sqlite conforms ?

2019-11-20 Thread Richard Hipp
On 11/20/19, Richard Hipp wrote: > On 11/20/19, Dennis Clarke wrote: >> >> In any case feels like a real problem. > > I am unable to reproduce the problem here. Can you run it under > valgrind to see if that provides any other clues? We have found a use-after-free problem in the test harness.

Re: [sqlite] What is the C language standard to which sqlite conforms ?

2019-11-20 Thread Warren Young
On Nov 19, 2019, at 8:43 PM, Dennis Clarke wrote: > > On 11/20/19 2:26 AM, Warren Young wrote: >> On Nov 19, 2019, at 7:06 PM, Dennis Clarke wrote: >>> >>> gmake: *** [Makefile:1256: tcltest] Segmentation fault (core dumped) >> … >>> CC=/opt/bw/gcc9/bin/gcc >> You’re using a nonstandard

Re: [sqlite] Optimising query with aggregate in subselect.

2019-11-20 Thread Andy Bennett
Hi, ORDER BY "key" DESC This should be ASC, not DESC: I've been working on versions of the query that can go forwards and backwards and made an editor snafu when writing the eMail. Best wishes, @ndy -- andy...@ashurst.eu.org http://www.ashurst.eu.org/ 0x7EBA75FF

[sqlite] Optimising query with aggregate in subselect.

2019-11-20 Thread Andy Bennett
Hi, I'm trying to implement a "streaming" version of the classic "select the latest version of a record" query. By "streaming" I mean a query that executes by streaming what it needs out of tables and indexes as it needs it rather than using temporary b-trees or materializing anything up

Re: [sqlite] Entity Framework Core support

2019-11-20 Thread Digital Dog
On Mon, Nov 18, 2019 at 2:23 AM Joe Mistachkin wrote: > > Mike King wrote: > > > > "It needs to be clearly stated somewhere that EF 6.3 is meant only as a > > tool for migrating from .NET Framework, and that EF Core is the version > > that should be used." *2 > > > > Given the phrasing here, it

Re: [sqlite] What is the C language standard to which sqlite conforms ?

2019-11-20 Thread Dennis Clarke
On 11/20/19 3:45 PM, Richard Hipp wrote: On 11/20/19, Dennis Clarke wrote: In any case feels like a real problem. I am unable to reproduce the problem here. Can you run it under valgrind to see if that provides any other clues? I will give that a try. Dennis

Re: [sqlite] Optimising query with aggregate in subselect.

2019-11-20 Thread Richard Damon
On 11/20/19 1:26 PM, Simon Slavin wrote: > On 20 Nov 2019, at 6:11pm, Andy Bennett wrote: > >> In past attempts at improving query performance these have been added to >> encourage it to use an index that it can do a SCAN thru' rather than the >> table that it would need to do a SEARCH thru'. >

Re: [sqlite] What is the C language standard to which sqlite conforms ?

2019-11-20 Thread Dennis Clarke
On 11/20/19 1:04 PM, Richard Hipp wrote: On 11/20/19, Dennis Clarke wrote: However the tests fail repeatedly with a code dump : Unable to reproduce the problem. What do you get when you run: ./testfixture test/walvfs.test What version of TCL are you linking against? For casual