Skip to content
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

Speed up the repeat expansion window by optimizing SQL #615

Merged
merged 3 commits into from
Jan 16, 2025
Merged

Conversation

ubuntolog
Copy link
Collaborator

@ubuntolog ubuntolog commented Jan 13, 2025

With these changes the table is created 8-9 times faster

@ubuntolog ubuntolog requested a review from marc-sturm January 13, 2025 11:41
@marc-sturm
Copy link
Member

This is too complicated, imho.

I would just fill a DBTable with all the data from the repeat_expansion table.
Then, for each repeat entry in the file, you iterate through through the table to determine the row index in the DBTable.
Then you get all all values you need.

NGSD db;
SqlQuery re_query = db.getQuery();
re_query.exec("SELECT * FROM repeat_expansion");
QList<QMap<QString, QString>> re_table_data;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why no DBTable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was easier to use, I guess. Can I use the filtering from DBTable to find id by region and repeat_unit?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the same loop as you do now.
You just have to determine the column indices before the loop.

@ubuntolog ubuntolog merged commit 5a0c934 into master Jan 16, 2025
6 checks passed
@ubuntolog ubuntolog deleted the re_window branch January 16, 2025 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants