-
Notifications
You must be signed in to change notification settings - Fork 90
improve performance by introducing composite index for datachunks #9293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,8 @@ module.exports = [{ | |
| { | ||
| fields: { | ||
| dedup_key: 1, | ||
| system: 1, | ||
| bucket: 1 | ||
| }, | ||
| options: { | ||
| unique: false, | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||||||||||||||||||||||||||||||||||||
| /* Copyright (C) 2025 NooBaa */ | ||||||||||||||||||||||||||||||||||||||
| "use strict"; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| async function run({ dbg, db_client }) { | ||||||||||||||||||||||||||||||||||||||
| /* After the index is dropped, a new composite index (system, bucket, dedup_key) | ||||||||||||||||||||||||||||||||||||||
| will be created during bootstrap */ | ||||||||||||||||||||||||||||||||||||||
| const indexName = 'idx_btree_datachunks_dedup_key'; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||
| const pool = db_client.instance().get_pool(); | ||||||||||||||||||||||||||||||||||||||
| await pool.query(`DROP INDEX IF EXISTS ${indexName};`); | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| dbg.log0("Executed upgrade script for dropping index ", indexName); | ||||||||||||||||||||||||||||||||||||||
| } catch (err) { | ||||||||||||||||||||||||||||||||||||||
| dbg.error('An error ocurred in the upgrade process:', err); | ||||||||||||||||||||||||||||||||||||||
| throw err; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+9
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tighten error logging message (typo and missing context). Functionally this looks good and idempotent; only nit is the error log text. There’s a typo and the message doesn’t mention which index failed, which can hinder debugging. - } catch (err) {
- dbg.error('An error ocurred in the upgrade process:', err);
- throw err;
- }
+ } catch (err) {
+ dbg.error('An error occurred while dropping index', indexName, err);
+ throw err;
+ }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| module.exports = { | ||||||||||||||||||||||||||||||||||||||
| run, | ||||||||||||||||||||||||||||||||||||||
| description: 'Delete the "idx_btree_datachunks_dedup_key" index' | ||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.