Why is ODBC.jl extremely slow using snowflake driver

Hi all :slight_smile:

I’m using ODBC.jl with snowflake. I ran into a problem though while using the replace function in the query string.

For example:
1.)

SELECT
    replace(col_name, '.', ' ') as col_name
FROM
    db.tb

is very very slow. But
2.)

SELECT
    col_name
FROM
    db.tb

runs normal.

I don’t understand why that is. I tried the first string within python (pyodbc, same driver and db) and it was fast/normal.

Can anybody reproduce this or give me any advice what to test next?

Cheers Lars

I am not sure if this is faster as I have not used Snowflake via ODBC, but you can now query and connect to snowflake via the Snowflake SQL Rest API with TidierDB.jl v.1.9
Here is further documentation

ac_id = "string_id"
token = "OAuth_token_string"
con = connect(:snowflake, ac_id, token, "DEMODB", "PUBLIC", "COMPUTE_WH")
# After connection is established, a you may begin querying.
stable_table_metadata = db_table(con, "MTCARS")

julia> @chain  begin
           from_query(stable_table)
           @mutate(COLUMN1 = str_remove(COLUMN1, "M"))
           @show_query
           #@collect
       end
WITH cte_2 AS (
SELECT  REGEXP_REPLACE(COLUMN1, "M", "") AS COLUMN1, MPG, CYL, DISP, HP, DRAT, WT, QSEC, VS, AM, GEAR, CARB
        FROM DEMODB.PUBLIC.MTCARS)  
SELECT *
        FROM cte_2
1 Like