Thanks to visit codestin.com
Credit goes to github.com

Skip to content

huda-lab/decidb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54,555 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Optimization, Native in SQL

DecidB extends DuckDB with declarative optimization.
Select optimal subsets of data with constraints and objectives — no external tools required.

Quick Example

SELECT item, value, weight, x AS selected
FROM Items
DECIDE x IS BOOLEAN
SUCH THAT
    SUM(x * weight) <= 50
MAXIMIZE SUM(x * value);

Why DecidB?

  • Native SQL — Express optimization as a SQL extension. No context switching between your database and an external solver.
  • Zero Data Movement — Solve directly on database buffers. No export/import overhead.
  • Declarative — Define what to optimize, not how. The system handles ILP formulation automatically.
  • Built on DuckDB — Columnar storage, vectorized execution, and an embedded HiGHS solver. Optional Gurobi support for commercial workloads.

DECIDE Syntax

SELECT select_list
FROM table_expression
[WHERE ...]
DECIDE variable_name [IS type] [, ...]
SUCH THAT constraint [AND constraint ...]
[MAXIMIZE | MINIMIZE] SUM|MIN|MAX(linear_expression)
Feature Details
Variable types IS BOOLEAN (0/1), IS INTEGER (non-negative, default), IS REAL (continuous)
Constraint operators =, <, <=, >, >=, <>, BETWEEN, IN
Aggregates SUM(), COUNT(), AVG(), MIN(), MAX()
Conditional expression WHEN condition (postfix)
Grouping SUM(expr) op rhs PER column — one constraint per distinct group

For the full syntax specification, see [context/descriptions/00_project_overview/syntax_reference.md](context/descriptions/00_project_overview/syntax_reference.md).

Building from Source

DecidB requires CMake, Python3, and a C++11 compliant compiler.

make release

Build output:

  • CLI: build/release/decidb
  • Library: build/release/src/libduckdb.so

Running Tests

make decide-test       # Run DECIDE differential tests
make decide-setup      # Setup test environment only

Tests are located in [test/decide/](test/decide/).

Example Problem Domains

DecidB can express a wide range of optimization problems directly in SQL:

  • Knapsack / Packing — Maximize value within weight or budget limits
  • Diet / Nutrition — Meet nutritional targets while minimizing cost
  • Portfolio Selection — Maximize return under risk constraints
  • Resource Allocation — Assign limited resources to maximize output
  • Production Planning — Optimize production quantities with capacity constraints
  • Assignment — Assign items to resources optimally
  • Scheduling — Complex constraint satisfaction over time slots
  • Multi-period Optimization — Time-indexed decision problems with carry-over constraints

Documentation

Full documentation lives in [context/descriptions/](context/descriptions/). Start with the README there for navigation and reading order.

Key areas:

  • [00_project_overview/](context/descriptions/00_project_overview/) — Syntax specification
  • [01_pipeline/](context/descriptions/01_pipeline/) — Query processing architecture
  • [03_expressivity/](context/descriptions/03_expressivity/) — Feature status (WHEN, PER, aggregates, etc.)
  • [04_optimizer/](context/descriptions/04_optimizer/) — Optimizer rewrite strategies

Research

DecidB is developed by the HUDA Lab (NYU Abu Dhabi), and UMass Amherst.

Foundation papers:

  • Scalable Package Queries in Relational Database Systems (VLDB 2016)
  • Scalable Computation of High-Order Optimization Queries (ACM Communications, 2019)
  • Scaling Package Queries to a Billion Tuples (VLDB 2024)

Contact: [email protected]

License

DecidB is released under the MIT License. See LICENSE for details.

About

DeciDB is an analytical in-process SQL database management system designed for Package Query

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors