Re: [sqlite] Unexpected result from SELECT * FROM (subquery);

2017-11-05 Thread Klaus Maas
Yes, correct. But the contents of the returned table are not objects, but merely values. In this case the returned table contains a single string value which happens to be the name of a table, but it is not the table. Or do I get this wrong? email signature Klaus Maas Klaus On

Re: [sqlite] Unexpected result from SELECT * FROM (subquery);

2017-11-05 Thread Klaus Maas
The table contains a single row with a single column that contains a string. Like this explanation. Much better than my attempt. What the outer select sees in its from clause is an ["unnamed-table"] that [contains one row containing 'tab1']. Thank you for pushing this point. The point I was

Re: [sqlite] Feature request: merge joins (preferably through a hint)

2017-11-05 Thread Richard Hipp
On 11/5/17, Davor Josipovic wrote: > Merge joins could be an incredible optimization in some cases for large > queries and would make sqlite much faster in such cases. SQLite does do a merge in some cases, though not for what you would traditionally call a join. For example,

Re: [sqlite] Unexpected result from SELECT * FROM (subquery);

2017-11-05 Thread Richard Hipp
On 11/5/17, Shane Dev wrote: > > In sqlite3, I executed the following statements - > > sqlite> select name from tabs where rowid=1; > tab1 > sqlite> select * from tab1; > first rec > > sqlite> select * from (select name from tabs where rowid=1); > tab1 > > I expected the

Re: [sqlite] Unexpected result from SELECT * FROM (subquery);

2017-11-05 Thread Peter Da Silva
The table contains a single row with a single column that contains a string. That doesn't make it a string. It's still a table. When you say "select ... from table" it doesn't matter where the table came from, it's still an operation on a table. You are not performing "select ... from 'tab1';",

Re: [sqlite] Unexpected result from SELECT * FROM (subquery);

2017-11-05 Thread Peter Da Silva
On 2017-11-05, at 05:28, Klaus Maas wrote: > I thought it was because what SQL returns is a value (in this case a string) > and not an object? > > The string value might be the same as the name of an object, but is not the > object. Select returns a table, not a name or a

[sqlite] sqlite3PcacheCleanAll() is CPU Bound on Windows 2K8R2

2017-11-05 Thread Jacob Fehr
Good Morning all, I am hoping to get some help with an issue that we see periodically. We have a machine that does low volume, low stress but long term testing of our application. We have been able to get SQLite to become CPU bound after about 3 days of longevity testing on Windows Server

Re: [sqlite] Feature request: merge joins (preferably through a hint)

2017-11-05 Thread Simon Slavin
On 5 Nov 2017, at 11:04am, Richard Hipp wrote: > SQLite does do a merge in some cases, though not for what you would > traditionally call a join. For example, SQLite will do a merge to > combine the two halves of this query: > >SELECT a,b,c FROM tab1 UNION SELECT x,y,z

Re: [sqlite] Unexpected result from SELECT * FROM (subquery);

2017-11-05 Thread Klaus Maas
I thought it was because what SQL returns is a value (in this case a string) and not an object? The string value might be the same as the name of an object, but is not the object. email signature Klaus Maas Klaus On

[sqlite] Feature request: merge joins (preferably through a hint)

2017-11-05 Thread Davor Josipovic
Are there any plans to implement merge joins in sqlite? As far as I am aware, only nested loops are currently supported. Merge joins could be an incredible optimization in some cases for large queries and would make sqlite much faster in such cases. Personally, I would like to have this option

[sqlite] Unexpected result from SELECT * FROM (subquery);

2017-11-05 Thread Shane Dev
Hello, In sqlite3, I executed the following statements - sqlite> select name from tabs where rowid=1; tab1 sqlite> select * from tab1; first rec sqlite> select * from (select name from tabs where rowid=1); tab1 I expected the last statement to evaluate the subquery first to be 'tab1' and then

Re: [sqlite] [sqlite-dev] SQLite 3.16.2-3 - Incomplete support for ISO8601 strings with time zone

2017-11-05 Thread Keith Medcalf
As explained on the linked page, right near the top: "The date and time functions use a subset of IS0-8601 date and time formats." SUBSET means some of, but not all of. ISO-8601 permits 24 hours, 60 minutes, and 61 seconds in a day. However, this is not part of the "supported subset"

[sqlite] json1 WebPage

2017-11-05 Thread Brady McCary
sqlite-users, I found a minor documentation formatting issue. On the page https://sqlite.org/json1.html in the overview section in items 7 and 15, the arguments to the functions are not all italicized. I tried to figure out how to make a ticket in the web interface to Fossil, but I couldn't

Re: [sqlite] memory leak

2017-11-05 Thread Yuriy M. Kaminskiy
On 11/05/17 03:28 , Lev wrote: > I'm fighting with some memory leak. From time to time the vsize of the > process goes up with 100k. I have several function like this, and I > call them in each second. My memory growth happens every 10 minutes or > so. > > int dbSqliteSelectSensorsToReport(sdmd_t

Re: [sqlite] [EXTERNAL] memory leak

2017-11-05 Thread Hick Gunter
You are preparing statements inside the loop, but only finalizing the last one (i.e. outside the loop) -Urspr√ľngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Lev Gesendet: Sonntag, 05. November 2017 01:28 An:

Re: [sqlite] [EXTERNAL] DB on JFFS

2017-11-05 Thread Hick Gunter
In addition to putting mutiple inserts within a single transaction (this saves "disc" IO), you might like to look into using parameters (this saves on CPU spent parsing/compiling the statements. This leaves you with: (setup) connect prepare BEGIN (loop) bind step reset (cleanup) END finalize

Re: [sqlite] [EXTERNAL] Unexpected result from SELECT * FROM (subquery);

2017-11-05 Thread Hick Gunter
Because the query planner needs to know the name(s) of the table(s) required for the query at "prepare time" and your query does not provide the name until "run time". -Urspr√ľngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Shane