You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pydef py_sin(s:int) ->float:
"sinus function : example loading module, handling input/output as strings"
import math as py_math
return ( py_math.sin(s*1));
WITH RECURSIVE
cnt(x) AS (
SELECT 1
UNION ALL
SELECT x+1 FROM cnt
where x < 300000
)
select sum(py_sin(x)) from cnt
takes 130 seconds, while 0.4 seconds with SQLite
WITH RECURSIVE
cnt(x) AS (
SELECT 1
UNION ALL
SELECT x+1 FROM cnt
where x < 300000
)
select sum(sin(x)) from cnt
takes also 110 seconds, while 0.1 second with SQLite integrated math
pydef py_sin(s:int) ->float:
"sinus function : example loading module, handling input/output as strings"
import math as py_math
return ( py_math.sin(s*1));
WITH
cnt(x) AS (
SELECT * from generate_series (1, 30000 )
)
select sum(py_sin(x)) from cnt
`````
This takes 0.1 second to duckdb
`````
WITH cnt(x) AS (select * from generate_series(1, 3000000) )
select sum(sin(x)) from cnt ;
````
Activity
stonebig commentedon Aug 27, 2023
this takes 1 second (or less) on duckdB:
select sum(sin(x)) from range(1 ,300001)cnt(x)so 10 seconds are due to not liking "recursive" CTE in a 300 000 loop (30 000 loop /second limit)
Then there is a big slowdown in using UDF, versus SQLite.
( 3 000 loop/second limit, versus 300 000 loop/second for SQLite)
not using "recursive" CTE and not using UDF (in this test) makes it quick like SQLite
stonebig commentedon Sep 3, 2023
when duckdb gets less bad at UDF, it will be an interesting change
becoming fluent with massive datas makes tcl/tk a problem.
stonebig commentedon Sep 30, 2023
This takes 10 seconds to duckdb