[RC5] psearch stats script (rc5) question
bwilson at fers.com
Mon Jan 10 09:26:30 EST 2000
|> The problem is that in order to allow the most flexible search
|> possible, the script would search for the string entered anywhere
|> in the email field. ("*string*"). Unfortunately, Sybase can't
|> optimize this query, and it was killing the box.
|Can Sybase optimize a search of the form ("*string")? I usually
|searched on my domain ("erols.com") so that I can see how I rank
|against others from my ISP. And a front wildcard is all that's
|necessary to search that way.
Sybase can only optimize queries of the form "= 'string'" or "like
'string%'" because the indexes sort the data in order from the first
character to the last.
This isn't a flaw in Sybase - try going to the Library and looking through a
card catalog for every book title ending with 'ing'. You'd have to look at
every card. (When SQL does this, it's called a table-scan.) If you really
needed to look up books by last letter, you'd want a separate card catalog
(or "index") sorted by reverse name.
This item is on my to-do list, but it hasn't made it to the top yet. Since
Sybase doesn't have an "index reverse order", we'll have to create a new
field which contains "moc.slore at siller" and index it. Then, when you type
in "erols.com" and choose an "ends-with" search, we'll reverse your input
and search using "begins with" (like 'moc.slore%'), which Sybase can
Of course, searching on this field means creating it and keeping it up to
date as new records come in. Among other things, we have to rebuild the
table of all participants. As you can imagine, I'm not really interested in
touching anything that could bring down stats until after CSC is finished.
Bruce Wilson, Manager, FERS
bwilson at fers.com, 312.245.1750, http://www.fers.com
PGP KeyID: 5430B995
"Give me ambiguity or give me something else."
To unsubscribe, send 'unsubscribe rc5' to majordomo at lists.distributed.net
rc5-digest subscribers replace rc5 with rc5-digest
More information about the rc5