Tech News
← Home  ·  All topics

Query Performance

2 GoKawiil briefs on this topic · RSS for query performance

DuckDB 2.0 adds VARIANT type that 'shreds' JSON for faster queries

DuckDB 2.0 introduces VARIANT as a native data type, replacing text-based JSON storage. The engine analyzes JSON fields during checkpointing and extracts consistent fields—like a field that is always a number or always text—into real typed columns, leaving only the inconsistent or rare fields in a binary remainder.

Postgres SELECT DISTINCT scans full result set despite indexing, DBOS finds

DBOS engineers debugging a Postgres-backed queue system found that SELECT DISTINCT was their most expensive query, even though it appeared simplest. They discovered that Postgres always scans every row matching a query's predicates when computing DISTINCT values, regardless of indexing or how few unique values exist, making it a poor fit for finding active partitions in a queue workload.