Hello,
Thanks to Keith's help I succeeded to set up a comparison a "native" sqrt()
versus a "python" mysqrt() function .
The speed-up in a best case non-realistic scenario is only 40%.
create_function() looks very performant.
Regards,
___
I built-in an extension which defines all the standard math functions as SQL
functions.
>-Original Message-
>From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
>boun...@sqlite.org] On Behalf Of big stone
>Sent: Monday, 10 March, 2014 13:22
>To: sqlite-users@sqlite.org
>Subject:
Hello Keith,
Thanks for the ".timer on" tip.
I only succeed to get a "Error: not such function : sqrt" from default
Sqlite.exe
How did you get that "native" sqrt working ?
regards,
___
sqlite-users mailing list
sqlite-users@sqlite.org
On 10 Mar 2014, at 1:38am, Stephen Chrzanowski wrote:
> Apologies for the interruption and sort of off topic, but, is .timer part
> of the CLI only or is it part of the SQL language? Can I get the result of
> a timer from a call, or do I have to put a wrapper on my
On Sunday, 9 March, 2014 19:38, Stephen Chrzanowski
inquired:
>Apologies for the interruption and sort of off topic, but, is .timer part
>of the CLI only or is it part of the SQL language? Can I get the result
>of a timer from a call, or do I have to put a wrapper on my
Apologies for the interruption and sort of off topic, but, is .timer part
of the CLI only or is it part of the SQL language? Can I get the result of
a timer from a call, or do I have to put a wrapper on my wrapper?
On Sun, Mar 9, 2014 at 8:17 PM, Keith Medcalf wrote:
>
>
sqlite> create virtual table n using wholenumber;
sqlite> .timer on
sqlite> select sum(sqrt(value)) from n where value between 1 and 1000;
21097.4558874807
Run Time: real 0.001 user 0.00 sys 0.00
sqlite> select sum(sqrt(value)) from n where value between 1 and 100;
67166.458841
Hello Max,
Your link is pretty interesting. It looks that :
- method1 should be easily implemented with SQLite "floating point"
representation,
- and with a very very small code size.
Here is the benchmarking of the two available methods :
On Sat, Mar 8, 2014 at 2:24 AM, big stone wrote:
> Ooups !
>
> Thanks to the awesome posts about "RPAD/LPAD", I understood that I could
> already create a "sqrt()" function for SQLite3 in interpreted python.
>
Yes, that discussion was inspiring :)
Looking at your task I
Ooups !
Thanks to the awesome posts about "RPAD/LPAD", I understood that I could
already create a "sqrt()" function for SQLite3 in interpreted python.
(example) ***
import sqlite3
db_filename = ':memory:'
def mysqrt(s):
""" returns sqrt(s)"""
#must return a string, apparently
On Fri, Feb 14, 2014 at 2:33 PM, Max Vlasov wrote:
> Hi,
>
> Some time ago when there was no "instr" functions, I looked at Mysql help
> pages and implemented a user function "locate" as the one that allows
> searching starting a particular position in the string. With two
+1 .
A few more 'classic/simple' sql instructions would not be a bad thing :
sqrt(), locate(substring, string, start), ...
They are not in a sql official "normalisation", but :
- '%' is not either,
- avg() looks a little bit incomplete without sqrt().
Hi,
Some time ago when there was no "instr" functions, I looked at Mysql help
pages and implemented a user function "locate" as the one that allows
searching starting a particular position in the string. With two parameters
form it was just identical to "instr" only the order of parameters was
13 matches
Mail list logo