|
1 | | -# SQL CLI v1.66.0 |
| 1 | +# SQL CLI v1.67.0 |
2 | 2 |
|
3 | | -**Release Date:** November 02, 2025 |
| 3 | +**Release Date:** November 05, 2025 |
4 | 4 |
|
5 | | -## 📊 Release Overview |
6 | | -- **Commits in this release:** 12 |
7 | | -- **Files updated:** 42 |
8 | | - |
9 | | -## ✨ Highlights |
| 5 | +## 🚀 Window Function Performance Revolution - 86% Faster! |
10 | 6 |
|
11 | | -### 🔍 Enhanced Debugging |
12 | | -- **Better Diagnostics**: Improved error messages and state dumps |
| 7 | +This release brings dramatic performance improvements to window functions through our new batch evaluation engine. Complex analytical queries now run up to **86% faster** on large datasets! |
13 | 8 |
|
14 | | -## 📝 Changes by Category |
15 | | - |
16 | | -### 🚀 New Features |
17 | | -- Add SELECT * EXCLUDE syntax support (DuckDB compatibility) |
18 | | -- Add complete line geometry analysis toolkit |
19 | | -- Add comprehensive vector mathematics support |
20 | | -- Add ILIKE operator support (PostgreSQL compatibility) |
| 9 | +## 📊 Release Overview |
| 10 | +- **Major Performance Boost**: 86% improvement for window functions |
| 11 | +- **New Functions**: RANK and DENSE_RANK window functions |
| 12 | +- **Smart Optimization**: Automatic O(n) algorithms for cumulative patterns |
| 13 | +- **Zero Configuration**: All improvements enabled by default |
21 | 14 |
|
22 | | -### 🐛 Bug Fixes |
23 | | -- Fix test_examples.py capture for multi-statement JSON output |
24 | | -- Remove REPLACE keyword to avoid conflict with REPLACE() function |
| 15 | +## ✨ Highlights |
25 | 16 |
|
26 | | -### 📚 Documentation |
27 | | -- Update roadmap to reflect completed features |
28 | | -- Add temp table example to README showing multi-stage -q queries |
| 17 | +### 🎯 Blazing Fast Window Functions |
| 18 | +- **50,000 rows with LAG**: 2.24s → **350ms** (86% improvement!) |
| 19 | +- **Cumulative SUM**: Previously timing out → Now **338ms** |
| 20 | +- All window functions now use optimized batch evaluation by default |
| 21 | + |
| 22 | +### 📈 What's Optimized |
| 23 | +- ✅ Window aggregates: `SUM`, `AVG`, `MIN`, `MAX`, `COUNT`, `FIRST_VALUE`, `LAST_VALUE` |
| 24 | +- ✅ Positional functions: `LAG`, `LEAD`, `ROW_NUMBER` |
| 25 | +- ✅ Ranking functions: `RANK`, `DENSE_RANK` (newly implemented!) |
| 26 | +- ✅ Smart O(n) algorithms for cumulative patterns |
| 27 | + |
| 28 | +## 📝 Example Usage |
| 29 | + |
| 30 | +```sql |
| 31 | +-- This query is now 86% faster! |
| 32 | +SELECT |
| 33 | + sale_date, |
| 34 | + amount, |
| 35 | + SUM(amount) OVER (ORDER BY sale_date ROWS UNBOUNDED PRECEDING) as running_total, |
| 36 | + AVG(amount) OVER (ORDER BY sale_date ROWS 30 PRECEDING) as moving_avg_30, |
| 37 | + LAG(amount, 1) OVER (ORDER BY sale_date) as prev_amount, |
| 38 | + RANK() OVER (ORDER BY amount DESC) as sales_rank |
| 39 | +FROM sales |
| 40 | +ORDER BY sale_date; |
| 41 | +``` |
| 42 | + |
| 43 | +## 🔧 Technical Details |
| 44 | + |
| 45 | +### Performance Improvements |
| 46 | +- **Batch Evaluation**: Process all rows in a single pass instead of per-row evaluation |
| 47 | +- **Hash-Based Caching**: Pre-create and cache WindowContext objects (50,000 lookups → 1) |
| 48 | +- **Running Aggregates**: O(n) incremental calculation for UNBOUNDED PRECEDING frames |
| 49 | +- **Smart Detection**: Automatically optimizes cumulative and running total patterns |
| 50 | + |
| 51 | +### Configuration |
| 52 | +- Batch evaluation is **enabled by default** - no configuration needed! |
| 53 | +- To opt-out (not recommended): Set `SQL_CLI_BATCH_WINDOW=0` |
| 54 | +- Complex expressions automatically use the optimal evaluation strategy |
| 55 | + |
| 56 | +## 🐛 Bug Fixes |
| 57 | +- Fixed window aggregate functions (AVG) returning incorrect results in certain cases |
| 58 | +- Fixed Python test suite warnings about test functions returning values |
| 59 | +- Fixed expression evaluation for window functions embedded in calculations |
| 60 | + |
| 61 | +## 📋 Full Commit List |
29 | 62 |
|
30 | 63 | <details> |
31 | | -<summary>📋 View all commits</summary> |
32 | | - |
33 | | -- chore: Bump version to 1.66.0 and update CHANGELOG (TimelordUK) |
34 | | -- fix: Fix test_examples.py capture for multi-statement JSON output (TimelordUK) |
35 | | -- test: Add formal test for SELECT * EXCLUDE feature (TimelordUK) |
36 | | -- feat: Add SELECT * EXCLUDE syntax support (DuckDB compatibility) (TimelordUK) |
37 | | -- feat(sql): Add complete line geometry analysis toolkit (TimelordUK) |
38 | | -- feat(sql): Add comprehensive vector mathematics support (TimelordUK) |
39 | | -- ci: Add performance benchmarking to GitHub Actions workflow (TimelordUK) |
40 | | -- fix: Remove REPLACE keyword to avoid conflict with REPLACE() function (TimelordUK) |
41 | | -- chore: Add EXCLUDE and REPLACE tokens to lexer (TimelordUK) |
42 | | -- feat: Add ILIKE operator support (PostgreSQL compatibility) (TimelordUK) |
43 | | -- docs: Update roadmap to reflect completed features (TimelordUK) |
44 | | -- docs: Add temp table example to README showing multi-stage -q queries (TimelordUK) |
| 64 | +<summary>View all commits</summary> |
| 65 | + |
| 66 | +- feat: Make batch window evaluation the default and fix expression handling |
| 67 | +- fix: Update Python tests to use assertions instead of return values |
| 68 | +- feat: Optimize window aggregates for UNBOUNDED PRECEDING frames |
| 69 | +- feat: Implement batch evaluation for window functions - 86% performance improvement! |
| 70 | +- feat: Window function optimization Phase 2 + Step 0 prep for batch evaluation |
| 71 | +- feat: Add Phase 1 window function profiling infrastructure |
45 | 72 |
|
46 | 73 | </details> |
47 | 74 |
|
48 | 75 | ## 🎯 Key Features |
49 | 76 |
|
| 77 | +- **Window Functions**: Now with 86% better performance! |
50 | 78 | - **Instant Data Preview**: CSV/JSON files load immediately |
51 | | -- **Visual Feedback**: Key press indicator, cell highlighting |
52 | | -- **Advanced Navigation**: Vim-style keys, viewport/cursor lock |
| 79 | +- **Advanced SQL**: CTEs, subqueries, window functions, aggregates |
53 | 80 | - **Powerful Search**: Regular search (Ctrl+F), fuzzy filter (Ctrl+/) |
54 | 81 | - **Data Export**: Save as CSV or JSON |
55 | | -- **Debug Mode**: Press F5 for comprehensive state information |
| 82 | +- **Vim Navigation**: Full vim-style key bindings |
56 | 83 |
|
57 | 84 | ## 📦 Installation |
58 | 85 |
|
59 | | -Download the binary for your platform from the assets below. |
| 86 | +```bash |
| 87 | +cargo install sql-cli |
| 88 | +``` |
| 89 | + |
| 90 | +Or download the binary for your platform from the assets below. |
| 91 | + |
| 92 | +## 📈 Upgrade Recommendation |
| 93 | + |
| 94 | +**Highly recommended upgrade** for anyone using window functions, especially on large datasets. The performance improvements are substantial and all existing queries will automatically benefit. |
60 | 95 |
|
61 | 96 | --- |
| 97 | + |
62 | 98 | **Thank you for using SQL CLI!** 🎉 |
63 | 99 |
|
64 | 100 | Report issues: [GitHub Issues](https://github.com/TimelordUK/sql-cli/issues) |
| 101 | +Full changelog: [CHANGELOG.md](https://github.com/TimelordUK/sql-cli/blob/main/CHANGELOG.md) |
0 commit comments