diff --git a/camel/camel-db.c b/camel/camel-db.c
index 5e7ce51..5fc5c9e 100644
--- a/camel/camel-db.c
+++ b/camel/camel-db.c
@@ -1453,52 +1453,78 @@ static gint
 read_fir_callback (gpointer  ref, gint ncol, gchar ** cols, gchar ** name)
 {
 	CamelFIRecord *record = *(CamelFIRecord **) ref;
-	gint i;
+	gint i, old_i;
 
 	d(g_print ("\nread_fir_callback called \n"));
-#if 0
-	record->folder_name = cols [0];
-	record->version = cols [1];
-	/* Just a sequential mapping of struct members to columns is enough I guess.
-	Needs some checking */
-#else
 
-	for (i = 0; i < ncol; ++i) {
-		if (!strcmp (name [i], "folder_name"))
+	/* Keep values in order as stored in a table and name all columns, for better performance */
+	for (i = 0; i < ncol; i++) {
+		old_i = i;
+
+		if (!strcmp (name [i], "folder_name")) {
 			record->folder_name = g_strdup(cols [i]);
+			i++;
+		}
 
-		else if (!strcmp (name [i], "version"))
+		if (!strcmp (name [i], "version")) {
 			record->version = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
+			i++;
+		}
 
-		else if (!strcmp (name [i], "flags"))
+		if (!strcmp (name [i], "flags")) {
 			record->flags = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
+			i++;
+		}
 
-		else if (!strcmp (name [i], "nextuid"))
+		if (!strcmp (name [i], "nextuid")) {
 			record->nextuid = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
+			i++;
+		}
 
-		else if (!strcmp (name [i], "time"))
+		if (!strcmp (name [i], "time")) {
 			record->time = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
+			i++;
+		}
 
-		else if (!strcmp (name [i], "saved_count"))
+		if (!strcmp (name [i], "saved_count")) {
 			record->saved_count = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
+			i++;
+		}
 
-		else if (!strcmp (name [i], "unread_count"))
+		if (!strcmp (name [i], "unread_count")) {
 			record->unread_count = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
+			i++;
+		}
 
-		else if (!strcmp (name [i], "deleted_count"))
+		if (!strcmp (name [i], "deleted_count")) {
 			record->deleted_count = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
+			i++;
+		}
 
-		else if (!strcmp (name [i], "junk_count"))
+		if (!strcmp (name [i], "junk_count")) {
 			record->junk_count = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
-		else if (!strcmp (name [i], "visible_count"))
+			i++;
+		}
+
+		if (!strcmp (name [i], "visible_count")) {
 			record->visible_count = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
-		else if (!strcmp (name [i], "jnd_count"))
+			i++;
+		}
+
+		if (!strcmp (name [i], "jnd_count")) {
 			record->jnd_count = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
-		else if (!strcmp (name [i], "bdata"))
+			i++;
+		}
+
+		if (!strcmp (name [i], "bdata")) {
 			record->bdata = g_strdup (cols [i]);
+			i++;
+		}
 
+		if (i != old_i)
+			i--;
 	}
-#endif
+
 	return 0;
 }
 
@@ -1521,7 +1547,7 @@ camel_db_read_message_info_record_with_uid (CamelDB *cdb, const gchar *folder_na
 	gchar *query;
 	gint ret;
 
-	query = sqlite3_mprintf ("SELECT uid, flags, size, dsent, dreceived, subject, mail_from, mail_to, mail_cc, mlist, part, labels, usertags, cinfo, bdata FROM %Q WHERE uid = %Q", folder_name, uid);
+	query = sqlite3_mprintf ("SELECT * FROM %Q WHERE uid = %Q", folder_name, uid);
 	ret = camel_db_select (cdb, query, read_mir_callback, p, ex);
 	sqlite3_free (query);
 
@@ -1534,7 +1560,7 @@ camel_db_read_message_info_records (CamelDB *cdb, const gchar *folder_name, gpoi
 	gchar *query;
 	gint ret;
 
-	query = sqlite3_mprintf ("SELECT uid, flags, size, dsent, dreceived, subject, mail_from, mail_to, mail_cc, mlist, part, labels, usertags, cinfo, bdata FROM %Q ", folder_name);
+	query = sqlite3_mprintf ("SELECT * FROM %Q ", folder_name);
 	ret = camel_db_select (cdb, query, read_mir_callback, p, ex);
 	sqlite3_free (query);
 
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 0bd1276..22c1fe6 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -530,12 +530,64 @@ camel_folder_summary_peek_info (CamelFolderSummary *s, const gchar *uid)
 	return info;
 }
 
+enum {
+	DB_COL_uid,
+	DB_COL_flags,
+	DB_COL_msg_type,
+	DB_COL_read,
+	DB_COL_deleted,
+	DB_COL_replied,
+	DB_COL_important,
+	DB_COL_junk,
+	DB_COL_attachment,
+	DB_COL_dirty,
+	DB_COL_size,
+	DB_COL_dsent,
+	DB_COL_dreceived,
+	DB_COL_subject,
+	DB_COL_mail_from,
+	DB_COL_mail_to,
+	DB_COL_mail_cc,
+	DB_COL_mlist,
+	DB_COL_followup_flag,
+	DB_COL_followup_completed_on,
+	DB_COL_followup_due_by,
+	DB_COL_part,
+	DB_COL_labels,
+	DB_COL_usertags,
+	DB_COL_cinfo,
+	DB_COL_bdata,
+	DB_COL_created,
+	DB_COL_modified,
+	DB_COL_bodystructure,
+	DB_COL_LAST
+};
+
 struct _db_pass_data {
 	CamelFolderSummary *summary;
 	gboolean double_ref;
 	gboolean add; /* or just insert to hashtable */
+	gboolean is_reload;
+	gint col_indexes[DB_COL_LAST];
 };
 
+static void
+init_db_pass_data (struct _db_pass_data *data)
+{
+	gint i;
+
+	g_return_if_fail (data != NULL);
+
+	data->summary = NULL;
+	data->double_ref = FALSE;
+	data->add = FALSE;
+	data->is_reload = FALSE;
+
+	for (i = 0; i < DB_COL_LAST; i++) {
+		data->col_indexes[i] = -1;
+	}
+}
+
 static CamelMessageInfo *
 message_info_from_uid (CamelFolderSummary *s, const gchar *uid)
 {
@@ -563,6 +615,8 @@ message_info_from_uid (CamelFolderSummary *s, const gchar *uid)
 		CAMEL_SUMMARY_UNLOCK(s, ref_lock);
 		CAMEL_SUMMARY_UNLOCK(s, summary_lock);
 
+		init_db_pass_data (&data);
+
 		data.summary = s;
 		data.double_ref = TRUE;
 		data.add = FALSE;
@@ -987,10 +1041,13 @@ camel_folder_summary_reload_from_db (CamelFolderSummary *s, CamelException *ex)
 	folder_name = s->folder->full_name;
 	cdb = s->folder->parent_store->cdb_r;
 
+	init_db_pass_data (&data);
+
 	/* FIXME FOR SANKAR: No need to pass the address of summary here. */
 	data.summary = s;
 	data.double_ref = FALSE;
 	data.add = FALSE;
+	data.is_reload = TRUE;
 	ret = camel_db_read_message_info_records (cdb, folder_name, (gpointer)&data, camel_read_mir_callback, NULL);
 
 	s->cache_load_time = time (NULL);
@@ -1111,64 +1168,190 @@ camel_folder_summary_load_from_db (CamelFolderSummary *s, CamelException *ex)
 }
 
 static void
-mir_from_cols (CamelMIRecord *mir, CamelFolderSummary *s, gint ncol, gchar ** cols, gchar ** name)
+mir_from_cols (CamelMIRecord *mir, CamelFolderSummary *s, gint *col_indexes, gint ncol, gchar ** cols, gchar ** name)
 {
-	gint i;
+	gint i, old_i;
 
-	for (i = 0; i < ncol; ++i) {
+	/* Keep values in order as stored in a table and name all columns, for better performance */
+	for (i = 0; i < ncol; i++) {
+		old_i = i;
 
-		if ( !strcmp (name [i], "uid") )
+		#define is_db_col(col_name, col_id) (col_indexes[DB_COL_ ## col_id] == -1 && !strcmp (name [i], col_name)) || i == col_indexes [DB_COL_ ## col_id]
+		if (is_db_col ("uid", uid)) {
+			col_indexes [DB_COL_uid] = i;
 			mir->uid = (gchar *) camel_pstring_strdup (cols [i]);
-		else if ( !strcmp (name [i], "flags") )
+			i++;
+		}
+
+		if (is_db_col ("flags", flags)) {
+			col_indexes [DB_COL_flags] = i;
 			mir->flags = cols [i] ? strtoul (cols [i], NULL, 10) : 0;
-		else if ( !strcmp (name [i], "read") )
+			i++;
+		}
+
+		if (is_db_col ("msg_type", msg_type)) {
+			col_indexes [DB_COL_msg_type] = i;
+			i++;
+		}
+
+		if (is_db_col ("read", read)) {
+			col_indexes [DB_COL_read] = i;
 			mir->read =  (cols [i]) ? ( ((strtoul (cols [i], NULL, 10)) ? TRUE : FALSE)) : FALSE;
-		else if ( !strcmp (name [i], "deleted") )
+			i++;
+		}
+
+		if (is_db_col ("deleted", deleted)) {
+			col_indexes [DB_COL_deleted] = i;
 			mir->deleted = (cols [i]) ? ( ((strtoul (cols [i], NULL, 10)) ? TRUE : FALSE)) : FALSE;
-		else if ( !strcmp (name [i], "replied") )
+			i++;
+		}
+
+		if (is_db_col ("replied", replied)) {
+			col_indexes [DB_COL_replied] = i;
 			mir->replied = (cols [i]) ? ( ((strtoul (cols [i], NULL, 10)) ? TRUE : FALSE)) : FALSE;
-		else if ( !strcmp (name [i], "important") )
+			i++;
+		}
+
+		if (is_db_col ("important", important)) {
+			col_indexes [DB_COL_important] = i;
 			mir->important = (cols [i]) ? ( ((strtoul (cols [i], NULL, 10)) ? TRUE : FALSE)) : FALSE;
-		else if ( !strcmp (name [i], "junk") )
+			i++;
+		}
+
+		if (is_db_col ("junk", junk)) {
+			col_indexes [DB_COL_junk] = i;
 			mir->junk = (cols [i]) ? ( ((strtoul (cols [i], NULL, 10)) ? TRUE : FALSE)) : FALSE;
-		else if ( !strcmp (name [i], "attachment") )
+			i++;
+		}
+
+		if (is_db_col ("attachment", attachment)) {
+			col_indexes [DB_COL_attachment] = i;
 			mir->attachment = (cols [i]) ? ( ((strtoul (cols [i], NULL, 10)) ? TRUE : FALSE)) : FALSE;
-		else if ( !strcmp (name [i], "size") )
+			i++;
+		}
+
+		if (is_db_col ("dirty", dirty)) {
+			col_indexes [DB_COL_dirty] = i;
+			i++;
+		}
+
+		if (is_db_col ("size", size)) {
+			col_indexes [DB_COL_size] = i;
 			mir->size =  cols [i] ? strtoul (cols [i], NULL, 10) : 0;
-		else if ( !strcmp (name [i], "dsent") )
+			i++;
+		}
+
+		if (is_db_col ("dsent", dsent)) {
+			col_indexes [DB_COL_dsent] = i;
 			mir->dsent = cols [i] ? strtol (cols [i], NULL, 10) : 0;
-		else if ( !strcmp (name [i], "dreceived") )
+			i++;
+		}
+
+		if (is_db_col ("dreceived", dreceived)) {
+			col_indexes [DB_COL_dreceived] = i;
 			mir->dreceived = cols [i] ? strtol (cols [i], NULL, 10) : 0;
-		else if ( !strcmp (name [i], "subject") )
+			i++;
+		}
+
+		if (is_db_col ("subject", subject)) {
+			col_indexes [DB_COL_subject] = i;
 			mir->subject = (gchar *) camel_pstring_strdup (cols [i]);
-		else if ( !strcmp (name [i], "mail_from") )
+			i++;
+		}
+
+		if (is_db_col ("mail_from", mail_from)) {
+			col_indexes [DB_COL_mail_from] = i;
 			mir->from = (gchar *) camel_pstring_strdup (cols [i]);
-		else if ( !strcmp (name [i], "mail_to") )
+			i++;
+		}
+
+		if (is_db_col ("mail_to", mail_to)) {
+			col_indexes [DB_COL_mail_to] = i;
 			mir->to = (gchar *) camel_pstring_strdup (cols [i]);
-		else if ( !strcmp (name [i], "mail_cc") )
+			i++;
+		}
+
+		if (is_db_col ("mail_cc", mail_cc)) {
+			col_indexes [DB_COL_mail_cc] = i;
 			mir->cc = (gchar *) camel_pstring_strdup(cols [i]);
-		else if ( !strcmp (name [i], "mlist") )
+			i++;
+		}
+
+		if (is_db_col ("mlist", mlist)) {
+			col_indexes [DB_COL_mlist] = i;
 			mir->mlist = (gchar *) camel_pstring_strdup (cols [i]);
-		else if ( !strcmp (name [i], "followup_flag") )
+			i++;
+		}
+
+		if (is_db_col ("followup_flag", followup_flag)) {
+			col_indexes [DB_COL_followup_flag] = i;
 			mir->followup_flag = (gchar *) camel_pstring_strdup(cols [i]);
-		else if ( !strcmp (name [i], "followup_completed_on") )
+			i++;
+		}
+
+		if (is_db_col ("followup_completed_on", followup_completed_on)) {
+			col_indexes [DB_COL_followup_completed_on] = i;
 			mir->followup_completed_on = (gchar *) camel_pstring_strdup(cols [i]);
-		else if ( !strcmp (name [i], "followup_due_by") )
+			i++;
+		}
+
+		if (is_db_col ("followup_due_by", followup_due_by)) {
+			col_indexes [DB_COL_followup_due_by] = i;
 			mir->followup_due_by = (gchar *) camel_pstring_strdup(cols [i]);
-		else if ( !strcmp (name [i], "part") )
+			i++;
+		}
+
+		if (is_db_col ("part", part)) {
+			col_indexes [DB_COL_part] = i;
 			mir->part = g_strdup (cols [i]);
-		else if ( !strcmp (name [i], "labels") )
+			i++;
+		}
+
+		if (is_db_col ("labels", labels)) {
+			col_indexes [DB_COL_labels] = i;
 			mir->labels = g_strdup (cols [i]);
-		else if ( !strcmp (name [i], "usertags") )
+			i++;
+		}
+
+		if (is_db_col ("usertags", usertags)) {
+			col_indexes [DB_COL_usertags] = i;
 			mir->usertags = g_strdup (cols [i]);
-		else if ( !strcmp (name [i], "cinfo") )
+			i++;
+		}
+
+		if (is_db_col ("cinfo", cinfo)) {
+			col_indexes [DB_COL_cinfo] = i;
 			mir->cinfo = g_strdup(cols [i]);
-		else if ( !strcmp (name [i], "bdata") )
+			i++;
+		}
+
+		if (is_db_col ("bdata", bdata)) {
+			col_indexes [DB_COL_bdata] = i;
 			mir->bdata = g_strdup(cols [i]);
-		/* Evolution itself doesn't yet use this, ignoring
-		else if ( !strcmp (name [i], "bodystructure") )
+			i++;
+		}
+
+		if (is_db_col ("created", created)) {
+			col_indexes [DB_COL_created] = i;
+			i++;
+		}
+
+		if (is_db_col ("modified", modified)) {
+			col_indexes [DB_COL_modified] = i;
+			i++;
+		}
+
+		if (is_db_col ("bodystructure", bodystructure)) {
+			col_indexes [DB_COL_bodystructure] = i;
+			/* Evolution itself doesn't yet use this, ignoring
 			mir->bodystructure = g_strdup(cols [i]); */
+			i++;
+		}
+
+		#undef is_db_col
 
+		if (i != old_i)
+			i--;
 	}
 }
 
@@ -1179,19 +1362,25 @@ camel_read_mir_callback (gpointer  ref, gint ncol, gchar ** cols, gchar ** name)
 	CamelFolderSummary *s = data->summary;
 	CamelMIRecord *mir;
 	CamelMessageInfo *info;
-	gint ret = 0;
+	gint ret = 0, i;
+
+	if (!data->is_reload) {
+		for (i = 0; i < ncol; i++) {
+			if (!strcmp (name [i], "uid")) {
+				CAMEL_SUMMARY_LOCK (s, summary_lock);
+				if (g_hash_table_lookup (s->loaded_infos, cols [i])) {
+					/* Unlock and better return*/
+					CAMEL_SUMMARY_UNLOCK (s, summary_lock);
+					return ret;
+				}
+				CAMEL_SUMMARY_UNLOCK (s, summary_lock);
+				break;
+			}
+		}
+	}
 
 	mir = g_new0 (CamelMIRecord , 1);
-	mir_from_cols (mir, s, ncol, cols, name);
-
-	CAMEL_SUMMARY_LOCK (s, summary_lock);
-	if (g_hash_table_lookup (s->loaded_infos, mir->uid)) {
-		/* Unlock and better return*/
-		CAMEL_SUMMARY_UNLOCK (s, summary_lock);
-		camel_db_camel_mir_free (mir);
-		return ret;
-	}
-	CAMEL_SUMMARY_UNLOCK (s, summary_lock);
+	mir_from_cols (mir, s, data->col_indexes, ncol, cols, name);
 
 	info = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->message_info_from_db (s, mir);
 
