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 <onlyjob@debian.org> 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
upstream-use-QAtomicInt.patch
upstream_dont_call_insert_from_Q_ASSERT.patch
upstream_dont_leak_old_external_payload_files.patch
upstream_opt-0001-skip-value-condition-on-invalid-flags.patch
upstream_opt-0002-intern-entity-strings.patch
upstream_opt-0003-QMutexLocker.patch
upstream_opt-0004-one-hash-lookup.patch
upstream_opt-0005-optimize-queries.patch
upstream_opt-0006-cache-PartTypes.patch
upstream_opt-0007-avoid-recursive-listing-in-SearchHelper.patch
From 7cbff48f5782d1f7f844678e6b785aeb419b0c47 Mon Sep 17 00:00:00 2001
From: Milian Wolff <mail@milianw.de>
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, f.id() );
}
qb.addCondition( cond );
--
2.1.4
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