[evolution-data-server/openismus-work] Fix cursor API for JEFT JOIN optimization by David Woodhouse



commit de6e975e1432d11feb972cb2cb7d566061ba6a78
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Mon May 27 22:55:47 2013 +0900

    Fix cursor API for JEFT JOIN optimization by David Woodhouse

 .../libedata-book/e-book-backend-sqlitedb.c        |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-backend-sqlitedb.c 
b/addressbook/libedata-book/e-book-backend-sqlitedb.c
index 7ade413..d529fae 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.c
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.c
@@ -4959,12 +4959,12 @@ ebsdb_cursor_setup_query (EBookBackendSqliteDB *ebsdb,
        if (query_with_list_attrs) {
                gchar *list_table = g_strconcat (cursor->folderid, "_lists", NULL);
 
-               stmt = sqlite3_mprintf ("SELECT DISTINCT summary.uid, vcard, bdata "
-                                       "FROM %Q AS summary, %Q AS multi",
+               stmt = sqlite3_mprintf ("SELECT DISTINCT summary.uid, vcard, bdata FROM %Q AS summary "
+                                       "LEFT OUTER JOIN %Q AS multi ON summary.uid = multi.uid",
                                        cursor->folderid, list_table);
 
-               count_stmt = sqlite3_mprintf ("SELECT count(DISTINCT summary.uid) "
-                                             "FROM %Q AS summary, %Q AS multi",
+               count_stmt = sqlite3_mprintf ("SELECT count(DISTINCT summary.uid), vcard, bdata FROM %Q AS 
summary "
+                                             "LEFT OUTER JOIN %Q AS multi ON summary.uid = multi.uid",
                                              cursor->folderid, list_table);
                g_free (list_table);
        } else {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]