Skip to content

A small patchset to optimize KisResourceModel::resetQuery

Dmitry Kazakov requested to merge dkazakov/krita:kazakov/query-optimize into master

The patchset started as a bugfix for bug 446146, when realoding a brush was too slow, but ended up with a bigger optimization.

Commit 1

Don't include thumbnails into normal SQL queries
    
It makes the queries too slow to operate. Instead, the thumbnails are
now fetched using a separate query via resource_id.
    
It increases the speed of KisAllResourcesModel::resetQuery() from
400ms to 0ms (with a lot of bundles active)

Commit 2

Add an index for resource signature
    
We need this index to be able to group-by (name,filename,md5)
efficiently. This index makes the query in the KisResourceModel
execute almost instantly.
    
This patch increases the schema version from 0.0.16 to 0.0.17!

Commit 3 (real bugfix ;) )

Don't reset the query when reloading a resource
    
We don't have to call reset query here, because reloading a resource
doesn't change any database content.

Merge request reports

Loading