Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #68360

imapclient Gmail search() times

From Grant Edwards <invalid@invalid.invalid>
Newsgroups comp.lang.python
Subject imapclient Gmail search() times
Date 2014-03-14 18:53 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <lfvj84$1n4$1@reader1.panix.com> (permalink)

Show all headers | View raw


I'm working on a small app to help sort/organize my mail via Gmail's
IMAP server, and I'm using imapclient (BTW it's a _huge_ improvement
over imaplib).

The odd thing I'm seeing is that when searching a large "folder" (All
Mail), I get wildly different times depending on what header I search.

  allmail = IMAPClient(HOST, use_uid=True, ssl=True, port=993)
  allmail.login(USERNAME, PASSWORD)
  allmail.select_folder('[Gmail]/All Mail')

Searching on "Message-Id:" is fast (sub-second):

  irt = allmail.search('HEADER Message-ID %s' % msgid)

Searching on "In-Reply-To:" takes 10-15 seconds:

  rt  = allmail.search('HEADER In-Reply-To %s' % msgid)

[IIRC, I've got about 22000 messages in the 'All Mail' "folder".]

I'm assuming this is just due to the way that Google implmented their
IMAP server code, but I thought I'd ask if anybody else had noticed
this.  Perhaps I'm doing something stupid, but I can't imagine what it
would be....
  
-- 
Grant Edwards               grant.b.edwards        Yow! I have a TINY BOWL in
                                  at               my HEAD
                              gmail.com            

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

imapclient Gmail search() times Grant Edwards <invalid@invalid.invalid> - 2014-03-14 18:53 +0000

csiph-web