[Developers] regexps

Tim Sturge tsturge at metaweb.com
Tue Oct 9 00:56:08 UTC 2007


It would be nice to support regular expressions. The reason we don't 
boils down to performance:

It's hard to index regular expressions; when someone does a query you'd 
like to look up things in an index rather than apply the regex to every 
value you have and see which match. It's also hard to know by looking at 
a regex how discriminating it is (what %age of the total things match 
it) so you can't usefully tell the optimizer "lots of things (>1% of 
total) match this" "only 4 or 5 things match this".

So we do word based indexing like a search engine does and therefore 
support primarily word based searching, since it's easy(-ier) to make 
this fast.

Tim

Kirrily Robert wrote:
> I was just wondering about the pattern matching in MQL, where the
> syntax came from, and whether you (i.e. Metaweb) considered using some
> kind of standard regexp library?  It seems to me as if more and more
> languages are moving towards supporting Perl/egrep/etc style regexps,
> and I was surprised to find something so different here.
>
> K.
>
>   



More information about the Developers mailing list