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

Optimize SQL Statements / result gathering #2007

Merged

Conversation

matthiasstraka
Copy link
Contributor

@matthiasstraka matthiasstraka commented Oct 6, 2021

In SQLDatabase::getChildCounts, we can require the database to return ordered parent_ids and speedup map insertion (the ORDER BY is only there for readability as the result should be ordered by default in both SQLite and MySQL because is uses an index on parent_id).

Also, some more libfmt-identifier() conversions.

/// \brief Set entire metadata dictionary by moving
void setMetaData(std::vector<std::pair<std::string, std::string>>&& metaData)
{
this->metaData = std::move(metaData);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if it's a good idea to have setters moving stuff.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why not? Isn't this a very common pattern and one of the main reasons for move?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm nvm.

@KarlStraussberger KarlStraussberger merged commit d9d02c9 into gerbera:master Oct 7, 2021
@matthiasstraka matthiasstraka deleted the batch_child_counts2 branch October 12, 2021 11:07
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.

None yet

3 participants