Re: [sqlite] Does wal-file support MMAP?

2017-11-18 Thread Howard Kapustein
On 10 Nov 2017, at 8:49am, advancenOO  wrote:

>hAve you optimised your column orders ?
What is optimal?

- Howard
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Unexpected echo when setting locking_mode

2017-11-18 Thread Simon Slavin


On 19 Nov 2017, at 2:01am, Kees Nuyt  wrote:

> The same happens for 
>   pragma journal_mode=wal;

Perhaps the PRAGMAs should be reviewed for consistency: that all PRAGMAs which 
change values should output their new value.

This might provide a useful piece of diagnostic information for some users.  
For example suppose someone changes the page_size using this:

PRAGMA page_size = 16384;

They change page_size to 16384 but they don’t know that that works only for an 
empty database, or after a VACUUM.  The PRAGMA outputs 4096 and, although they 
don’t yet know why, they do at least know that their change didn’t work 
properly.

Simon.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Unexpected echo when setting locking_mode

2017-11-18 Thread Kees Nuyt
On Sat, 18 Nov 2017 22:53:26 +0100, Yannick Duchêne
 wrote:

>I believe I found a tiny bug, nothing bad, but may pollute some output.
>
>Using SQLite version 3.20.1, if I do this:
>
>PRAGMA locking_mode=exclusive;
>
>It writes an unexpected reply:
>
>exclusive

The same happens for 
pragma journal_mode=wal;

, although it's less intrusive than locking_mode , because
journal_mode will typically only be issued at database creation.
-- 
Regards,
Kees Nuyt

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] View is not flattened when inside an IN sub-query

2017-11-18 Thread Richard Hipp
On 11/18/17, E.Pasma  wrote:
> I found that in the
> SQLite3 timeline

Thanks for watching the timeline!

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] View is not flattened when inside an IN sub-query

2017-11-18 Thread E.Pasma
Thanks very much for finding this worth a change. I found that in the  
SQLite3 timeline and I tested the change. As written in an other topic:


.. Just sit tight and again wait and see if Dr Hipp agrees the  
behavior should change or not.


It is comforting that this is even true for an unanswered and  
undiscussed message.

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Unexpected echo when setting locking_mode

2017-11-18 Thread Yannick Duchêne
Hello there,

I believe I found a tiny bug, nothing bad, but may pollute some output.

Using SQLite version 3.20.1, if I do this:

PRAGMA locking_mode=exclusive;

It writes an unexpected reply:

exclusive

It do as if I was requesting the actual value, as in this:

PRAGMA locking_mode;

If I do this, for an example other pragma:

PRAGMA auto_vacuum=none;

It works as expected, there is no unexpected output.

-- 
Yannick Duchêne
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Update the SQLite package in Tcl

2017-11-18 Thread Richard Hipp
On 11/18/17, Balaji Ramanathan  wrote:
> Hi,
>
> I have installed Tcl/Tk from a couple of places on the web (activetcl
> and magicsplat), and I find that neither of them has the latest version of
> sqlite3 as the standard sqlite3 package.  ActiveTcl seems to be linked to
> sqlite 3.13 while magicsplat's version comes with sqlite 3.20.
>
> What do I need to do to get them both up to sqlite 3.21?

On the SQLite download page, you will find both a Pre-release Snapshot
and a "sqlite-autoconf" tarball.  Download either of these.  (I
suggest the Pre-release Snapshot so that you can help us beta test!)

Untar, and cd into the "tea" subdirectory.  Then type:  "./configure;
make install".  That is suppose to install the latest SQLite for TCL.
"TEA" is the "Tcl Extension Architecture".


-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Update the SQLite package in Tcl

2017-11-18 Thread Balaji Ramanathan
Hi,

I have installed Tcl/Tk from a couple of places on the web (activetcl
and magicsplat), and I find that neither of them has the latest version of
sqlite3 as the standard sqlite3 package.  ActiveTcl seems to be linked to
sqlite 3.13 while magicsplat's version comes with sqlite 3.20.

What do I need to do to get them both up to sqlite 3.21?  I see that
their installations include a lib folder with a sqlite dll in it.  Is it
sufficient simply to replace that dll with the sqlite 3.21 dll?  I tried
that but it gave me error messages ("invalid argument, couldn't load dll",
etc.), so I am guessing there is more to it than that.

Better yet, is there a version of tcl/tk that is considered "official"
that is kept updated with the latest versions of all these packages so that
I don't have to wonder what comes packaged with which version of tcl I
download from where?

Thank you.

Balaji Ramanathan
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Confusion about DISTINCT keyword

2017-11-18 Thread Keith Medcalf

Neither.  It has nothing to do with the DISTINCT keyword, which causes only 
DISTINCT rows to be returned (duplicates are removed).

You misunderstanding is on the nature of a SCALAR.  A Scalar means ONE value.  
A correlated SCALAR subquery (a correlated subquery embedded as a column in a 
select statement) can only return a SINGLE SCALAR result.

It matters not whether your subquery returns 1 or 1,000,000 rows.  Only the 
value from the first row is returned.  Once this first row has been determined 
the subquery is terminated.  (That is, it always has " LIMIT 1" no matter what 
you might specify).

---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.


>-Original Message-
>From: sqlite-users [mailto:sqlite-users-
>boun...@mailinglists.sqlite.org] On Behalf Of Balaji Ramanathan
>Sent: Saturday, 18 November, 2017 09:05
>To: sqlite-users@mailinglists.sqlite.org
>Subject: [sqlite] Confusion about DISTINCT keyword
>
>I have the query below with one column in the final output coming
>from the
>main query and two columns in the final output coming from correlated
>subqueries:
>
>SELECT DISTINCT *modenumber*,
>
>
>(SELECT tripid
>
>FROM trip
>
>WHERE modenumber = T.modenumber
>
>ORDER BY distance DESC
>
>LIMIT 3
>
>) AS *tripid*,
>
>
>(SELECT distance
>
>FROM trip
>
>WHERE modenumber = T.modenumber
>
>ORDER BY distance DESC
>
>LIMIT 3
>
>) AS *distance*
>
>
>FROM trip T
>
>ORDER BY modenumber;
>
>
>I expected this query to produce at least 3x the number of distinct
>modenumbers because the results of the subqueries (especially the
>tripid)
>are different for each trip.  However, when I run it, I get only one
>row
>per modenumber.
>
>
>It is as if the DISTINCT keyword is applying only to the modenumber,
>and
>not to the other two columns in the select.  Is that because the
>other two
>columns are coming from subqueries?  The documentation does not
>explicitly
>mention subqueries, and only says distinct removes duplicate rows.
>In this
>case, it seems to think that the row consists of just the column from
>the
>main query and does not include the columns from the subqueries.
>
>
>Is this a bug or is this the expected behavior of the DISTINCT
>keyword?
>Thank you.
>
>
>Balaji Ramanathan
>___
>sqlite-users mailing list
>sqlite-users@mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Confusion about DISTINCT keyword

2017-11-18 Thread Balaji Ramanathan
I have the query below with one column in the final output coming from the
main query and two columns in the final output coming from correlated
subqueries:

SELECT DISTINCT *modenumber*,


(SELECT tripid

FROM trip

WHERE modenumber = T.modenumber

ORDER BY distance DESC

LIMIT 3

) AS *tripid*,


(SELECT distance

FROM trip

WHERE modenumber = T.modenumber

ORDER BY distance DESC

LIMIT 3

) AS *distance*


FROM trip T

ORDER BY modenumber;


I expected this query to produce at least 3x the number of distinct
modenumbers because the results of the subqueries (especially the tripid)
are different for each trip.  However, when I run it, I get only one row
per modenumber.


It is as if the DISTINCT keyword is applying only to the modenumber, and
not to the other two columns in the select.  Is that because the other two
columns are coming from subqueries?  The documentation does not explicitly
mention subqueries, and only says distinct removes duplicate rows.  In this
case, it seems to think that the row consists of just the column from the
main query and does not include the columns from the subqueries.


Is this a bug or is this the expected behavior of the DISTINCT keyword?
Thank you.


Balaji Ramanathan
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Good resources for TCL/TK

2017-11-18 Thread Cecil Westerhof
2017-11-18 15:14 GMT+01:00 Eric :

> On Sat, 18 Nov 2017 14:43:23 +0100, Cecil Westerhof <
> cldwester...@gmail.com> wrote:
> > I found the benefits for TCL/TK. But this is a SQLite mailing list, so
> not
> > the right place to ask questions if it is not connected to SQLite also.
> > What would be good resources for TCL/TK?
> >
>
> There is the Usenet group comp.lang.tcl , also accessible through Google
> Groups at https://groups.google.com/forum/#!forum/comp.lang.tcl .
>
> There is also the Tclers' Wiki at http://wiki.tcl.tk/ which is full
> of information. You can ask questions by editing them into the "Ask,
> and it shall be given" page http://wiki.tcl.tk/37862 .
>

​Thanks, I will look into those.


By the way TCL can calculate factorial 995 in less as 4 seconds. Not to bad.

-- 
Cecil Westerhof
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Good resources for TCL/TK

2017-11-18 Thread Eric
On Sat, 18 Nov 2017 14:43:23 +0100, Cecil Westerhof  
wrote:
> I found the benefits for TCL/TK. But this is a SQLite mailing list, so not
> the right place to ask questions if it is not connected to SQLite also.
> What would be good resources for TCL/TK?
> 

There is the Usenet group comp.lang.tcl , also accessible through Google
Groups at https://groups.google.com/forum/#!forum/comp.lang.tcl .

There is also the Tclers' Wiki at http://wiki.tcl.tk/ which is full
of information. You can ask questions by editing them into the "Ask,
and it shall be given" page http://wiki.tcl.tk/37862 .

Eric
-- 
ms fnd in a lbry
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Good resources for TCL/TK

2017-11-18 Thread Cecil Westerhof
I found the benefits for TCL/TK. But this is a SQLite mailing list, so not
the right place to ask questions if it is not connected to SQLite also.
What would be good resources for TCL/TK?

-- 
Cecil Westerhof
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users