[Xapian-discuss] Bug: scriptindex - xapian-omega 0.9.99_svn8484

Olly Betts olly at survex.com
Mon May 14 20:01:45 BST 2007


On Mon, May 14, 2007 at 10:42:12AM -0700, Kevin Duraj wrote:
> - The issue here is not padding numerical by zero and make numerical looks
> like strings.
> - The issue is not that this is common mistake.

There doesn't just have to be a single issue here!  Other people have
made this slip before, so it *is* an issue.  I'll move the warning to a
more prominent place in the documentation comments which may help.

> - The issue is: that sorting numerical is faster then sorting strings, or
> sorting strings is faster then numerical?
> - The issue is: What is faster when sorting?

Values are stored as strings, so sorting them as strings is fastest -
it's pretty much just a call to memcmp().  To sort them numerically
would require two calls to atoi() or similar, which is clearly more
work than calling memcmp(), especially as memcmp() can exit after
comparing just the first bytes.

Cheers,
    Olly



More information about the Xapian-discuss mailing list