Re: [sqlite] Common subexpression optimization of deterministic functions

2017-09-12 Thread raypoker79
Stop,,I'm not subscribed 


Sent via the Samsung Galaxy S7, an AT 4G LTE smartphone
 Original message From: Warren Young  Date: 
9/12/17  6:19 PM  (GMT-05:00) To: SQLite mailing list 
 Subject: Re: [sqlite] Common 
subexpression optimization of deterministic
  functions 
On Sep 12, 2017, at 2:36 PM, Jens Alfke  wrote:
> 
> On Sep 12, 2017, at 12:58 PM, Warren Young  wrote:
>> 
>> Could it be *extended* to mean what you want?  Of course, but that means 
>> you’re asking for a feature, not reporting a bug.
> 
> I never claimed to be reporting a bug!

I read your reference to an older version as implying that you thought this was 
a regression in functionality.  That is, that you thought this change first 
appeared in 3.19.
___
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


Re: [sqlite] Table-valued function crashing in SQLite 3.20

2017-09-12 Thread raypoker79
This is a scam and has been reported to attorney General and will be filing 
complaint with bbb,,I did not request this and habe cancelled all cards 


Sent via the Samsung Galaxy S7, an AT 4G LTE smartphone
 Original message From: Jens Alfke  Date: 
9/12/17  5:31 PM  (GMT-05:00) To: SQLite mailing list 
 Subject: Re: [sqlite] Table-valued 
function crashing in SQLite 3.20 


> On Sep 12, 2017, at 1:00 PM, Jens Alfke  wrote:
> 
> Thanks, this does look like exactly the same bug.
> But the latest snapshot at http://www.sqlite.org/download.html 
>   > is still the 201708251543 one. Did you 
> upload the new one somewhere else?

The new snapshot is visible to me now, and I can confirm that it fixes the 
crash. Thanks!

—Jens
___
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


Re: [sqlite] Common subexpression optimization of deterministic functions

2017-09-12 Thread raypoker79
This is a scam please take me off this email the card has been reported stolen 


Sent via the Samsung Galaxy S7, an AT 4G LTE smartphone
 Original message From: Darko Volaric  Date: 
9/12/17  4:41 PM  (GMT-05:00) To: SQLite mailing list 
, Jens Alfke  
Subject: Re: [sqlite] Common subexpression optimization of deterministic
functions 
You can implement this by using user defined functions to implement row "local 
variables" or "registers". They're single assignment storage that keeps 
intermediate results, namely the common subexpressions.

You'd define two functions, something like Get(rowid, name) and Set(rowid, 
name, value). You call Set with the subexpressions as the last parameter. It 
doesn't return any value and just stores the value. The Get function returns a 
previously set value with the given name and is used in the expressions where 
that subexpression would otherwise appear. Note that you would need to order 
these so they are evaluated in dependency order, i.e. ensure each name is set 
before it is got. The rowid parameter is used to detect when the row changes 
and the local variables are all cleared in readiness for the next row.



> On Sep 12, 2017, at 9:22 PM, Jens Alfke  wrote:
> 
> 
> 
>> On Sep 12, 2017, at 12:02 PM, Darren Duncan  wrote:
>> 
>> Practically speaking any optimization to reduce actual calls to the 
>> deterministic function would have to be at compile time to rewrite the query 
>> to explicitly keep the result of the function and use it several times,
> 
> Exactly.
> 
>> which is someone users can also do by writing the query differently.
> 
> Great — any advice on how to do it? I'm totally willing to do this :) but I'm 
> not sure how. As I said, a WITH clause looks promising, but I don't know if 
> that is purely syntactic sugar, like a macro. (And changing my query 
> generator to factor common calls into WITH clauses would be a nontrivial 
> amount of work, so I would like to get some assurance that it might help, 
> before I try it.)
> 
> The CSE optimization has long been standard in traditional compilers, even 
> though the programmer could get the same result by changing their code. (The 
> same is true of many other optimizations.) The benefit is that it lets the 
> developer write simpler, clearer code with less effort. 
> 
> I realize SQLite doesn't have the kind of industrial-strength query 
> optimizers that other SQL databases have, but (from an outside perspective) 
> this seems like a fairly straightforward optimization. SQLite is already 
> doing some similar tricks to recognize matching sub-expressions when it 
> applies an expression-based index to a query, for example.
> 
> —Jens
> ___
> 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-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users