[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Pushing AND, OR search to IMAP
- To: "wl-en@lists airs net" <wl-en@lists.airs.net>
- Subject: Pushing AND, OR search to IMAP
- From: Erik Hetzner <ehetzner@gmail.com>
- Date: Thu, 26 Aug 2010 16:59:47 -0700
- Delivered-to: wl-en@lists.airs.net
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:user-agent:mime-version:content-type :content-transfer-encoding; bh=QTFkdghBVTLYYCHeBLeB5wywSLy74SkGjrPMh4a2KX8=; b=sbO56xOevM58zr5yl7S7fSR/AufKQrdyATYHew8ik1OvddOQTpWDrK7bJWl3t5Uq4z VgAcdw1Q8Z22zwZONsILzzWEKXAH3eYIhp991fH2EwV2yBl7nJOOS+H0bq0R+SccCEij FLEFaNEcbAHsaCYtvnItM5TbEk/lKZR3O2a2M=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:user-agent:mime-version :content-type:content-transfer-encoding; b=r5gMA4oPTUmCZscXZXWAJj9n2402gpkMn8hjYYHTDbrKbXObXJzEhK6MjxGiqatxec 7+iZYaS/l+t7KheXCY6hXrWCnzg94mbmBm5Z+ecQ+1uGE5mWAxTX4gd3iK4B2TZdrBjr 5LqHvypAKrXTY0gK3c/wBomiWXPdwqoZLyIS8=
- List-help: <mailto:wl-en-ctl@lists.airs.net?body=help>
- List-id: wl-en.lists.airs.net
- List-owner: <mailto:wl-en-admin@lists.airs.net>
- List-post: <mailto:wl-en@lists.airs.net>
- List-software: fml [fml stable 20011102.2100]
- List-unsubscribe: <mailto:wl-en-ctl@lists.airs.net?body=unsubscribe>
- Reply-to: wl-en@lists.airs.net
- User-agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.7 Emacs/23.1 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)
Hi,
Attached is a rewrite of elmo-imap4-search functionality to simplify
the code somewhat and, more importantly, to move the ANDing and ORing
of search conditions to the IMAP server. Currently elmo performs each
subquery of an ANDed or ORed search, then either performs a union or
intersection of the retrieved message IDs within Emacs to get the
results. elmo-imap4-search2-* rewrites this to do as much as possible
on the IMAP server, which should reduce back and forth responses and
unnecessarily long result lists being transferred over the wire.
For instance, if I want to find messages written by me that contain
“foo” in the body:
/from:hetzner&body:foo
previously elmo would retrieve all msgids matching from:hetzner (a
large number when searching my archives, of course), then all msgids
matching body:foo, the calculate the union of the two lists. With this
rewrite, elmo will instead combine the searches into a single IMAP
command (if possible) and send the single command to the IMAP server,
where the union will be performed on the server. This means 1 command
instead of 2, and a large reduction in network traffic.
I have tested this, but I am looking for others to test if they are
able. If others are interested I will look into merging this into WL
proper. Thanks!
best, Erik
Attachment:
elmo-imap4-search2.el
Description: Binary data
Attachment:
pgp9mjskM_Jwd.pgp
Description: PGP signature