I am trying to set the threads use by DuckDB.
Doing SET threads TO 1;
or PRAGMA threads=1;
set number of threads to 1, but it somehow increases afterwards.
To recreate:
>>> import duckdb # line 1
>>> duckdb.execute("SET threads TO 1;") # line 2
<duckdb.duckdb.DuckDBPyConnection object at 0x7fb537744630>
>>> duckdb.execute("SELECT 1;").df() # line 3
1
0 1
>>> q = "SELECT * FROM duckdb_settings() WHERE name = 'threads';"
>>> duckdb.sql(q).df()
name value description input_type scope
0 threads 1 The number of total threads used by the system. BIGINT GLOBAL
After line 1
number of threads is 16.
After line 2
number of threads is changed to 1.
After execution of the line marked as line 3
the number of threads is becoming 16 again(checking in htop).