]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch-dump.c
dump: Don't sort the output by message id.
[notmuch] / notmuch-dump.c
index 409c86ada6dd709461da7b20e7732a3a345a3880..0475eb9d1a2d822109a5c71ab6122d096f0d0151 100644 (file)
@@ -41,6 +41,8 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[])
     if (notmuch == NULL)
        return 1;
 
+    argc--; argv++; /* skip subcommand argument */
+
     if (argc && strcmp (argv[0], "--") != 0) {
        fprintf (stderr, "Warning: the output file argument of dump is deprecated.\n");
        output = fopen (argv[0], "w");
@@ -71,7 +73,10 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[])
        fprintf (stderr, "Out of memory\n");
        return 1;
     }
-    notmuch_query_set_sort (query, NOTMUCH_SORT_MESSAGE_ID);
+    /* Don't ask xapian to sort by Message-ID. Xapian optimizes returning the
+     * first results quickly at the expense of total time.
+     */
+    notmuch_query_set_sort (query, NOTMUCH_SORT_UNSORTED);
 
     for (messages = notmuch_query_search_messages (query);
         notmuch_messages_valid (messages);