HeliosDB-Lite Quick Start Guide
Installation
HeliosDB-Lite is available to licensed customers; contact sales@heliosdb.com for access to the source distribution.
# Build from the unpacked source distributioncd heliosdb-litecargo build --release
# The binary will be at ./target/release/heliosdb-liteStarting HeliosDB-Lite
Option 1: Interactive REPL (Single-User Development)
# In-memory database; add --dump-on-shutdown to dump on exitheliosdb-lite repl --memory
# Persistent databaseheliosdb-lite repl -d ./mydbOption 2: Server Mode (Multi-User/Production)
export HELIOSDB_JWT_SECRET="$(openssl rand -hex 32)"# Start server (foreground)heliosdb-lite start -d ./mydb --port 5432
# Start as daemon (background)heliosdb-lite start --daemon -d ./mydb --port 5432
# Check status / stop daemonheliosdb-lite statusheliosdb-lite stopConnecting to Server Mode
Once the server is running, connect using any PostgreSQL client:
# Using psqlpsql -h 127.0.0.1 -p 5432
# Using connection stringpsql postgresql://127.0.0.1:5432/heliosdbFirst Steps in REPL
-- Get helpheliosdb> \h
-- Create a tableheliosdb> CREATE TABLE users ( -> id SERIAL PRIMARY KEY, -> name TEXT NOT NULL, -> email TEXT UNIQUE -> );Query OK
-- Insert dataheliosdb> INSERT INTO users (name, email) -> VALUES ('Alice', 'alice@example.com'), -> ('Bob', 'bob@example.com');Query OK, 2 rows affected
-- Query dataheliosdb> SELECT * FROM users; id | name | email----+-------+------------------ 1 | Alice | alice@example.com 2 | Bob | bob@example.com(2 rows)
-- List tablesheliosdb> \dTables: users
-- Describe tableheliosdb> \d usersTable: users──────────────────────────────────────────────────Column Type Nullable Primary Key──────────────────────────────────────────────────id Integer NO YESname Text NOemail Text YESEssential REPL Commands
Basic Commands
\h Show help\d List all tables\d <table> Describe table schema\dt List tables with details\timing Toggle query timing\q QuitBranches, Snapshots and Materialized Views
\branches List database branches\snapshots List time-travel snapshots\dmv List materialized views\compression Show compression statisticsSettings and Statistics
\set Show all settings\config Show configuration\stats Show database statistics\optimize <t> Optimization recommendationsHeliosProxy Quick Start
HeliosProxy is a standalone, Apache-2.0 PostgreSQL-wire connection router (see the HeliosProxy documentation). It runs in front of Lite as well as Nano, Full or stock PostgreSQL:
# Start HeliosProxy (separate binary)heliosdb-proxy --config proxy.toml
# Connect through proxypsql -h 127.0.0.1 -p 6432 -d heliosdbDistribCache Multi-Tier Caching
DistribCache provides L1/L2/L3 caching optimized for AI workloads:
| Tier | Latency | Best For |
|---|---|---|
| L1 Hot | <100μs | Per-connection, exact match |
| L2 Warm | <1ms | Shared, normalized queries |
| L3 Semantic | <10ms | AI workloads, RAG chunks |
-- Check cache hit ratesSELECT * FROM pg_distribcache_stats();
-- Configure cache for AI workloadsSET distribcache.ai_mode = on;SET distribcache.conversation_ttl = 3600;Essential SQL Commands
Settings Management
-- Show current settingsSHOW ALL;SHOW optimizer;SHOW work_mem;
-- Set timeoutsSET statement_timeout = 30000; -- 30 seconds
-- Set memorySET work_mem = 16384; -- 16MB
-- Enable optimizerSET optimizer = on;
-- Reset to defaultRESET work_mem;RESET ALL;REPL command alternatives:
\config Show configuration\set Show REPL variables\stats Show database statisticsTime-Travel Queries
-- Enable time-travelSET time_travel_enabled = on;
-- Query historical dataSELECT * FROM orders AS OF TIMESTAMP '2025-11-23 10:00:00' WHERE customer_id = 123;Database Branching
-- Create a branchCREATE DATABASE BRANCH dev FROM main AS OF NOW;
-- Work on branchUSE BRANCH dev;
-- Merge backMERGE DATABASE BRANCH dev INTO main;Materialized Views
-- Create materialized viewCREATE MATERIALIZED VIEW customer_stats AS SELECT customer_id, COUNT(*) as order_count, SUM(amount) as total_spent FROM orders GROUP BY customer_id;
-- Refresh (full, CONCURRENTLY or INCREMENTALLY); automatic refresh is plannedREFRESH MATERIALIZED VIEW customer_stats;
-- Query materialized viewSELECT * FROM customer_stats;Vector Search
-- Create table with vector columnCREATE TABLE documents ( id SERIAL PRIMARY KEY, content TEXT, embedding VECTOR(384));
-- Create vector indexCREATE INDEX ON documents USING hnsw(embedding);
-- Similarity searchSELECT id, contentFROM documentsORDER BY embedding <-> '[0.1, 0.2, ...]'::vectorLIMIT 10;Compression
-- Set compression for tableALTER TABLE large_table SET COMPRESSION zstd;
-- Check compression stats\compression large_tableConfiguration File
Basic Configuration (config.toml)
# Storage[storage]path = "./heliosdb-data"wal_enabled = truetime_travel_enabled = truecache_size = 536870912 # 512MB
# Server[server]listen_addr = "127.0.0.1"port = 5432max_connections = 100
# Performance[performance]worker_threads = 0 # Auto-detectsimd_enabled = trueparallel_query = true
# Optimizer[optimizer]enabled = truerandom_page_cost = 4.0 # 1.1 for SSD
# Compression[compression]default_type = "Zstd"level = 3Start with Configuration
export HELIOSDB_JWT_SECRET="$(openssl rand -hex 32)"# Copy examplecp config.example.toml config.toml
# Edit configurationnano config.toml
# Start with configheliosdb-lite start --data-dir ./mydb --config config.tomlCommon Use Cases
Analytics Workload
-- Configure for analyticsSET work_mem = 131072; -- 128MBSET shared_buffers = 1048576; -- 1GBSET optimizer = on;SET enable_seqscan = on;
-- Run analytics querySELECT DATE_TRUNC('day', created_at) as date, COUNT(*) as order_count, SUM(amount) as total_amountFROM ordersGROUP BY dateORDER BY date DESC;OLTP Workload
-- Configure for OLTPSET work_mem = 4096; -- 4MBSET statement_timeout = 5000; -- 5 secondsSET enable_indexscan = on;
-- Transactional queriesBEGIN;INSERT INTO orders (customer_id, amount) VALUES (123, 99.99);UPDATE customers SET total_spent = total_spent + 99.99 WHERE id = 123;COMMIT;Data Warehouse
-- Create materialized views for aggregationsCREATE MATERIALIZED VIEW daily_sales AS SELECT DATE_TRUNC('day', created_at) as date, product_id, COUNT(*) as sales_count, SUM(amount) as revenue FROM orders GROUP BY date, product_id;
-- Refresh on a schedule (for example from cron)REFRESH MATERIALIZED VIEW daily_sales INCREMENTALLY;
-- Query aggregated dataSELECT * FROM daily_salesWHERE date >= CURRENT_DATE - INTERVAL '30 days';Vector Similarity Search
-- Configure vector indexesSET vector_index_type = 'hnsw';SET hnsw_ef_construction = 200;
-- Create embeddings tableCREATE TABLE embeddings ( id SERIAL PRIMARY KEY, document_id INT, embedding VECTOR(384));
-- Create indexCREATE INDEX ON embeddings USING hnsw(embedding);
-- Similarity searchSELECT document_idFROM embeddingsORDER BY embedding <-> $1::vectorLIMIT 10;Performance Tips
-
Enable timing to identify slow queries:
\timing -
Use EXPLAIN to understand query plans:
EXPLAIN SELECT * FROM large_table WHERE id > 1000; -
Set appropriate timeouts:
SET statement_timeout = 30000; -- 30 seconds -
Tune memory for workload:
-- Analytics: more memorySET work_mem = 131072; -- 128MB-- OLTP: less memory, more concurrencySET work_mem = 4096; -- 4MB -
Use compression for large tables:
ALTER TABLE logs SET COMPRESSION zstd; -
Create materialized views for expensive queries:
CREATE MATERIALIZED VIEW expensive_query ASSELECT... complex query...;REFRESH MATERIALIZED VIEW expensive_query INCREMENTALLY;
Troubleshooting
Query too slow
-- Check query planEXPLAIN SELECT * FROM table WHERE condition;
-- Compare estimated and actual rows per stepEXPLAIN ANALYZE SELECT * FROM table WHERE condition;
-- Increase work memorySET work_mem = 16384;
-- Enable timing\timingOut of memory
-- Reduce work_memSET work_mem = 2048;
-- Disable parallel executionSET parallel_query = off;
-- Check current settingsSHOW work_mem;SHOW shared_buffers;Connection issues
export HELIOSDB_JWT_SECRET="$(openssl rand -hex 32)"# Check server status\server status
# Check configuration\config
# Restart serverheliosdb-lite start --data-dir ./mydb --config config.tomlNext Steps
-
Read the documentation:
-
Explore features:
- Time-travel queries
- Database branching
- Materialized views
- Vector search
-
Optimize performance:
-
Use EXPLAIN for query plans
-
Create appropriate indexes
-
Tune memory settings
-
Enable compression
-
Configure TLS/SSL
-
Enable authentication
-
Record changes to sensitive tables with triggers (built-in audit logging is planned)
-
Configure backups
-
Resources
- Documentation:
/docs/ - Examples:
/examples/ - Configuration:
config.example.toml - Deployment Modes:
docs/guides/MODE_SELECTION_GUIDE.md - Product page: https://www.heliosdb.com/lite.html
- Issues: support@heliosdb.com
Getting Help
-- In REPL\h General help\h <command> Command-specific help
-- Show settingsSHOW ALL;
-- Show configuration\config
-- Show statistics\statsQuick Reference Card
| Task | REPL | SQL | Config |
|---|---|---|---|
| List tables | \d | SELECT * FROM pg_tables | - |
| Set timeout | \set statement_timeout 30000 | SET statement_timeout = 30000; | [storage] query_timeout_ms = 30000 |
| Enable optimizer | \set optimizer on | SET optimizer = on; | [optimizer] enabled = true |
| Time-travel | \snapshots | AS OF TIMESTAMP '...' | [storage] time_travel_enabled = true |
| Compression | \compression | ALTER TABLE... SET COMPRESSION | [compression] default_type = "Zstd" |
| View config | \config | SHOW ALL; | - |
| Get help | \h | - | - |
Start with \h in the REPL.