Commit 93b22bdf authored by Dmitry Smirnov's avatar Dmitry Smirnov

Drop patches introduced in previous upload due to regressions

causing invalid SQL commands.
parent 9e4726f3
akonadi (1.13.0-7) unstable; urgency=medium
* Team upload.
* Removed some patches introduced in previous upload due to regressions
causing invalid SQL commands.
-- Dmitry Smirnov <> Mon, 20 Jul 2015 12:30:32 +1000
akonadi (1.13.0-6) unstable; urgency=medium
* Team upload.
......@@ -8,10 +8,7 @@ upstream-prevent-QTimer-negative-interval.patch
From 7cbff48f5782d1f7f844678e6b785aeb419b0c47 Mon Sep 17 00:00:00 2001
From: Milian Wolff <>
Date: Mon, 1 Dec 2014 11:59:12 +0100
Subject: [PATCH] Optimize: Skip value condition on invalid flags.
HandlerHelper::itemWithFlagsCount gets called quite often apparently
and I noticed that it was relatively slow from the Query Debugger
in Akonadi Console. EXPLAIN'ing the query showed that it was using
a slow-path for the WHERE FOO AND (BAR OR ASDF) condition. Here,
ASDF was always id = -1, the id of the $IGNORED flag, which
I apparently don't have. Getting rid of that condition simplifies
the query to WHERE FOO AND BAR, which is apparently much better
optimizable. Before, the query often showed a runtime of ~15ms.
Now it is down to ~9ms.
REVIEW: 121306
server/src/handlerhelper.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/server/src/handlerhelper.cpp b/server/src/handlerhelper.cpp
index 634a26c..82347b4 100644
--- a/server/src/handlerhelper.cpp
+++ b/server/src/handlerhelper.cpp
@@ -123,6 +123,10 @@ int HandlerHelper::itemWithFlagsCount( const Collection &col, const QStringList
// it hits an in-memory cache.
Q_FOREACH ( const QString &flag, flags ) {
const Flag f = Flag::retrieveByName( flag );
+ if (!f.isValid()) {
+ // since we OR this condition, we can skip invalid flags to speed up the query
+ continue;
+ }
cond.addValueCondition( PimItemFlagRelation::rightFullColumnName(), Query::Equals, );
qb.addCondition( cond );
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment