Repository navigation
[WIP] Optimize performance issues with AlaSQL database queries - #2209
Conversation
Co-authored-by: mathiasrw <[email protected]>
Co-authored-by: mathiasrw <[email protected]>
Co-authored-by: mathiasrw <[email protected]>
mathiasrw
left a comment
There was a problem hiding this comment.
For berformance test we dont want to use mocha, but just regular js script that will execute and tell the tmie. Please update the once in test/performance.
Please make a new test/test1027.js file that does use mocha and will confirm that indexes are updated and that the result is correct (but no performance testing in the main test/ folder)
|
@copilot Please see the last comment. |
… for correctness Co-authored-by: mathiasrw <[email protected]>
Done in commit 6ad268f. Performance tests are now plain JS scripts in
Correctness testing is in
All tests pass (507 passing). Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
mathiasrw
left a comment
There was a problem hiding this comment.
Please make one performance test file that uses functions to run same setup twice, but then loads the data differently (could be based on a flag passed) and prints the result so its clear we are doing the same thing but loading them differently.
Co-authored-by: mathiasrw <[email protected]>
Done in commit 5adffc1. Created
Example output: Run with:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Performance Investigation for Issue #1027
This PR investigates and addresses performance issues when querying data with joins after loading data directly into tables.
Progress
Root Cause
The
table.insert()function insrc/60createtable.jsonly updated PRIMARY KEY and UNIQUE indices, but NOT regular indices created withCREATE INDEX. This caused queries with joins to not benefit from manually created indices.Fix Implemented
Added code to update regular indices (stored in
table.inddefsandtable.indices) during INSERT operations. The fix:table.inddefsTest Structure
Per maintainer feedback, tests are now organized as:
Performance Comparison Test (recommended -
test/performance/#1027/perf-comparison.js):insert,direct, orbothnode test/performance/#1027/perf-comparison.js bothIndividual Performance Tests (plain JS scripts in
test/performance/#1027/):perf-join-index.js- Tests INSERT statementsperf-direct-load.js- Tests direct loadingnode test/performance/#1027/perf-join-index.jsCorrectness Tests (mocha in
test/test1027.js):yarn testTest Results
Files Changed
src/60createtable.js- Added index update logic totable.insert()functiontest/test1027.js- Mocha test for correctnesstest/performance/#1027/perf-comparison.js- NEW: Unified comparison testtest/performance/#1027/perf-join-index.js- Performance test with INSERTtest/performance/#1027/perf-direct-load.js- Performance test with direct loadingtest/performance/#1027/README.md- Updated documentationOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.