Repository navigation
Releases
Tessera 1.4.4
Tessera 1.4.4 fixes four problems. Three showed up when we ran queries derived from TPC-H, TPC-DS, and TPCx-BB, the Join Order Benchmark, and LDBC SNB with 1.4.1 in DuckDB, PostgreSQL, and Spark (these are not TPC results); the fourth is in how the AVX-512 and AMX code is linked. Queries, settings, and results are the same as in 1.4.1. (1.4.2 and 1.4.3 were tagged but not released: the DuckDB community build of 1.4.2 stopped on the fourth problem, and 1.4.3, which fixed it, did not link with GCC 15.)
Fixed
- With
OMP_PROC_BIND,OMP_PLACES, orGOMP_CPU_AFFINITYset, loading Tessera left DuckDB on one CPU. GCC's OpenMP runtime binds the thread that loads it to one CPU, and DuckDB's worker threads, created afterLOAD tessera, inherited that CPU, so the Join Order Benchmark ran 5.9x slower although none of its plans used Tessera. Tessera now gives the loading thread its CPUs back, and a thread that runs a Tessera query keeps the CPUs it had. - PostgreSQL: the planner took Tessera's output for one row, so a
NOT EXISTSor a join on the groups ran as a nested loop with one index lookup per group. On the friend-recommendation query of LDBC SNB BI (Q18, scale factor 100, rewritten so that Tessera computes its mutual-friend counts), Tessera was 2.1-2.4x slower than PostgreSQL alone; with 1.4.4 it is 1.04-1.98x faster. The scan now reports PostgreSQL's own estimate of the groups. - Spark: the operator built its matrix with as many threads as the input had partitions, which is a few for a large Parquet file. It now uses every thread, and the driver collects the input rows into primitive arrays. The pair count derived from TPCx-BB Q29, on data from DuckDB's TPC-DS generator at scale factor 100, takes 3.1 s instead of 6.1 s (Spark alone: 3.6 s), and the one derived from Q01 without its filters 16.6 s instead of 53.5 s (Spark alone: 73.1 s), on 16 cores.
- On a CPU without AVX-512, code outside Tessera's AVX-512 and AMX paths could run those paths' copies of standard library functions and stop with an illegal instruction: DuckDB with Tessera linked into its binary, and a C++ library that a process loads after Tessera's SQLite or PostgreSQL module (both engines load modules into the global symbol scope). The AVX-512 and AMX code now keeps its own copies.
Install
- SQLite in Python:
pip install sqlite-tessera - SQLite shell: download
tessera-sqlite-1.4.4-<platform>.tar.gzbelow, then.load ./tessera - Spark:
--packages io.github.gyuyeongkim:tessera-spark_2.13:1.4.4 --conf spark.sql.extensions=tessera.spark.TesseraExtensions - PostgreSQL:
pgxn install tessera_pg, ortessera_pg-1.4.4.zipbelow (make && make install) - DuckDB:
INSTALL tessera FROM community; LOAD tessera;. The community repository serves 1.4.1 until its update to 1.4.4 is merged.
The C interface is unchanged (version 5, soname 5).
Tessera 1.4.1
Tessera 1.4.1 sums and counts columns that hold NULLs as SQL does, and runs on the inputs and queries that analysts write most often, in DuckDB, PostgreSQL, and Spark, with the same SQL and the same results.
New
- Sums, averages, and counts over columns that may hold NULLs, in DuckDB, PostgreSQL, and Spark. A joined pair adds to a sum only when its factors are all non-NULL, a group without such a pair has a NULL sum, and
COUNT(col)counts the pairs wherecolis not NULL. A cosine over a pandas DataFrame with missing values, over a CSV file with empty fields, or over Parquet files in Spark (whose columns are all nullable) now runs in Tessera. - DuckDB: pandas DataFrames and Parquet and CSV files at the default settings. These inputs have no distinct counts, so the planner reads a sample of each input and counts the joined rows itself.
- The top values of each group,
RANK()orROW_NUMBER() OVER (PARTITION BY a.x ORDER BY agg DESC) <= k, in DuckDB, PostgreSQL, and Spark. The window stays above, and the operator keeps only the cells that can reach it. - Several different sums in one query, computed in one pass over the joined rows, such as a cosine (
SUM(a.v * b.v) / (sqrt(SUM(a.v * a.v)) * sqrt(SUM(b.v * b.v)))) or a Pearson correlation. - In DuckDB and PostgreSQL, sums of doubles at the edge of their range (overflow, underflow, Infinity, and NaN) give the same value or the same error as the engine.
The README lists the supported queries, what stays with each engine, and the settings.
Install
- SQLite in Python:
pip install sqlite-tessera - SQLite shell: download
tessera-sqlite-1.4.1-<platform>.tar.gzbelow, then.load ./tessera - Spark:
--packages io.github.gyuyeongkim:tessera-spark_2.13:1.4.1 --conf spark.sql.extensions=tessera.spark.TesseraExtensions - PostgreSQL:
pgxn install tessera_pg, ortessera_pg-1.4.1.zipbelow (make && make install) - DuckDB:
INSTALL tessera FROM community; LOAD tessera;. The community repository serves 1.3.0 until its update to 1.4.1 is merged; to use 1.4.1 before then, build from the repository root (see the README).
C interface
Version 5 adds several sums in one pass (tessera_c_set_many, tessera_c_add_many, tessera_c_next_many), exact integer sums and NULL factors among them (tessera_c_set_many_int, tessera_c_add_many2, tessera_c_next_many2, tessera_c_many_overflow), the top values of each group (tessera_c_set_group_top), floating-point errors (tessera_c_set_float_errors, tessera_c_set_float_accum, tessera_c_float_errors), and tessera_c_set_sum_limit. The shared library's soname is 5.
Tessera 1.3.0
Tessera 1.3.0 runs many more join-aggregates in DuckDB, PostgreSQL, and Spark, with the same SQL and the same results.
New forms
- Pair filters
<>andIS DISTINCT FROM, and comparisons between integer columns of different widths COUNT(DISTINCT a.k),AVG,SUMof one side's column, and a count, a sum, and an average together- Keys of several columns, and keys and groups computed from one side's columns
- Further group columns, and group columns with NULLs
- Filters on either input or on both
- Dates, timestamps, and decimals as keys and groups, and decimal weights
- In PostgreSQL, inputs read through their own plans: subqueries, views, CTEs, partitioned and foreign tables, and row-level security
PostgreSQL and Spark now also prune with HAVING and ORDER BY ... LIMIT. The README lists the supported queries.
Install
- SQLite in Python:
pip install sqlite-tessera - SQLite shell: download
tessera-sqlite-1.3.0-<platform>.tar.gzbelow, then.load ./tessera - Spark:
--packages io.github.gyuyeongkim:tessera-spark_2.13:1.3.0 --conf spark.sql.extensions=tessera.spark.TesseraExtensions - PostgreSQL:
pgxn install tessera_pg, ortessera_pg-1.3.0.zipbelow (make && make install) - DuckDB:
INSTALL tessera FROM community; LOAD tessera;. The community repository serves 1.2.1 until its update to 1.3.0 is merged; to use 1.3.0 before then, build from the repository root (see the README).
C interface
Version 4 adds mode 3 (a.x <> b.x), tessera_c_set_distinct_keys, tessera_c_set_two, tessera_c_next_batch2, and tessera_c_set_pair_filter.
Tessera 1.2.1
Tessera 1.2.1 makes each adapter installable from its engine's package channel and fixes two adapter issues.
Install
- SQLite in Python:
pip install sqlite-tessera - SQLite shell: download
tessera-sqlite-1.2.1-<platform>.tar.gzbelow, then.load ./tessera - Spark:
--packages io.github.gyuyeongkim:tessera-spark_2.13:1.2.1 --conf spark.sql.extensions=tessera.spark.TesseraExtensions - PostgreSQL:
tessera_pg-1.2.1.zipbelow is the PGXN distribution (make && make install) - DuckDB: build from the repository root (see the README)
Fixes
- SQLite: the extension loads into SQLite before 3.41, where it crashed in its first query.
sqlite3_interrupt()cancels a run on SQLite 3.41 or newer. - Spark: a cancelled statement stops Tessera's native run also under adaptive execution. The driver holds 24 bytes per result row instead of 32.
The binaries are for Linux on x86-64 (glibc 2.28 or newer) and macOS 14 or newer on Apple silicon. On Linux, the SQLite tarball and the Spark jar load GCC's OpenMP runtime, libgomp.so.1, which the wheel carries.
Tessera 1.2.0
Tessera 1.2.0 runs join-aggregates inside DuckDB, PostgreSQL, SQLite, and Spark.
- DuckDB v2.0.0. The extension builds from the repository root. Build with
DUCKDB_VERSION=v2.0.0for a loadable extension that an official DuckDB CLI accepts. - Small joins stay with the engine. The DuckDB adapter leaves a join to DuckDB's own plan below
tessera_min_expansionandtessera_min_expansion_crossestimated joined rows per input row (default 6). PostgreSQL and Spark have the same settings, at 0 by default. - PostgreSQL 18, SQLite 3, and Spark 4 (Scala 2.13). The Spark jar carries its JNI library.
- macOS on Apple silicon. The loadable DuckDB extension carries its OpenMP runtime.
See the README for building and using each adapter. The paper's measurements used release 1.1, and tag v1.1.1 reproduces its experiments.