SShortSingh.
Back to feed

samkhya Unifies Query Statistics Across DuckDB, DataFusion, Polars, and Postgres

0
·1 views

Modern data platforms often run multiple query engines — such as DuckDB, DataFusion, Polars, and Postgres — against the same underlying tables, but each engine computes and stores its own statistics independently. This fragmentation means expensive histograms and sketches built during an ELT pipeline are invisible to other engines' query optimizers, leading to poor query plans and wasted computation. An open-source tool called samkhya addresses this by serializing statistical sketches into versioned Iceberg Puffin sidecar files that any compatible engine adapter can read without re-deriving the data. The shared statistics include HyperLogLog distinct-count sketches, Bloom and Count-Min filters, equi-depth histograms, and 2D correlated histograms for join-key pairs. To guard against stale or incorrect sketches, samkhya applies a provable pessimistic bound ensuring that bad statistics can never cause a query plan to perform worse than engine defaults.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

LiteLLM disaster recovery requires database, config, and decryption key together

LiteLLM, an AI gateway proxy, is not stateless in team deployments — its PostgreSQL database stores virtual keys, user and team records, budgets, rate limits, and spend history. A full recovery requires three components restored together: the PostgreSQL database, the gateway configuration file, and the decryption key used to protect stored credentials. Restoring only the container or only the database is insufficient to return the system to a working state. The decryption key should be stored separately from the database backup to avoid keeping encrypted data and its key in the same location. Operators are advised to rehearse restores on throwaway instances and treat a never-tested backup as unverified.

0
ProgrammingHacker News ·

OpenNode Offers Bitcoin Payment Processing for Businesses

OpenNode is a Bitcoin payment processor designed to help businesses accept cryptocurrency transactions. The platform provides tools that enable merchants and developers to integrate Bitcoin payments into their services. It was shared on Hacker News, where it received 18 points and one comment. The service aims to simplify Bitcoin payment infrastructure for companies looking to adopt crypto-based transactions. No specific launch date or company details were provided in the submission.

0
ProgrammingDEV Community ·

Five Structured Output Patterns That Make AI Coding Agents More Reliable

A developer running a fully autonomous coding agent found that parsing AI responses with regex and string matching led to repeated failures in unattended production runs. Ambiguous phrasing, markdown formatting, and mid-answer reasoning changes caused the same parser logic to misread opposite outcomes. The fix was switching from free-form prose responses to schema-validated structured output using forced tool calls via the Anthropic API. Instead of asking the model to describe its decision, the approach forces it to populate a predefined JSON contract, eliminating format ambiguity entirely. The author outlines five specific patterns using Claude's tool-use feature that transformed the agent from unreliable to trustworthy in production.

samkhya Unifies Query Statistics Across DuckDB, DataFusion, Polars, and Postgres · ShortSingh