Thanks to visit codestin.com
Credit goes to github.com

Skip to content

sqlite_bro experiment with duck_db #1257

Open
@stonebig

Description

@stonebig

with duckdb-0.8.0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions