LiteJoin uses SQLite’s SQL dialect for join and window queries. Since all stream data is stored in SQLite tables, you have access to the full power of SQLite’s query engine.
Use timestamp and strftime() to limit queries to recent data:
-- Last hourWHERE timestamp > (strftime('%s', 'now') - 3600)-- Last 5 minutesWHERE timestamp > (strftime('%s', 'now') - 300)-- Last 24 hoursWHERE timestamp > (strftime('%s', 'now') - 86400)
Always include a time-bounded WHERE clause in join queries. Without it, queries scan the entire topic table, which degrades performance as data accumulates.
SELECT key, CASE WHEN json_extract(payload, '$.amount') > 1000 THEN 'high' WHEN json_extract(payload, '$.amount') > 100 THEN 'medium' ELSE 'low' END as priorityFROM orders