bug-recutils
[Top][All Lists]
Advanced

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

Re: [bug-recutils] Selection is extremely slow when fields with common n


From: John Darrington
Subject: Re: [bug-recutils] Selection is extremely slow when fields with common name exist
Date: Fri, 16 Aug 2013 20:49:33 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Aug 16, 2013 at 08:33:03PM +0200, Jose E. Marchesi wrote:
     
             Well presumably it's slow because it has to do a linear search 
through 
             the  list of field values.  So the obvious answer would be that 
for each field,
             there should be a hash table keyed on the field value.  That way, 
the search 
             time would go from O(n) to O(1).   But perhaps you had already 
thought of 
             that ...
         
         Working on it...
     
     I just pushed another optimization.  Now the query 'junk = "That"' in
     the provided database takes about half a second to execute in my
     machine.  That is some improvement... :)

It certainly sounds good.  How does it do with a query involing a regular 
expression
liek 'junk ~ "*ha*"' ?  I imagine that is a more difficult case to optimise.

J'

-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://keys.gnupg.net or any PGP keyserver for public key.

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]