wild card search on memcache
brad at danga.com
Fri Feb 18 08:55:03 PST 2005
BTW, a tree-based memcached is totally possible, but it'd only really work
for a single machine.
You have to remember that memcached is a hash of hashes, and that's how it
spreads load. Even if you could ask a single machine for a range of keys,
that's not to say one of the other 40 memcached servers doesn't also have
keys in that range. And then what --- clients iterating over all the
If you do want in-memory range searches, though, MySQL Cluster is your
answer. It does that, and more.
On Thu, 17 Feb 2005, Skylos wrote:
> it would be interesting, however, if you were to make a similar to
> memcached implimentation whre instead of using hashes, used a btree
> index, which is apparently great at finding data that can be found in
> sort-related ways, like ranges and stuff. anything greater than or
> equal to 'abc' and less than 'abd' should be efficient to find.
> But thats a whole new project. memcached.btree, anybody? :P
> On Thu, 17 Feb 2005 15:03:27 -0800, John McCaskey <johnm at klir.com> wrote:
> > On Wed, 2005-02-02 at 18:20 +1100, Sherman Chan wrote:
> > > Hi,
> > > I just play around memcached with PHP, and it's great, but I wonder
> > > does it supports wild card search, for example I would like to bring
> > > back all result with the key start with ABC
> > Not presently supported.
> > >
> > > is that possible to do that?
> > Of course it is theoretically possible to add this feature, but the
> > issue is that it would be very slow. A hash table is used internally to
> > represent the keys. Hash tables are great for lookup of an exact value,
> > but very slow for search for values that match a wildcard type search
> > (basically have to do a full table scan comparing each key).
> > >
> > > Thanks in advance
> > > Sherman
> > >
> > --
> > John A. McCaskey
> > Software Development Engineer
> > Klir Technologies, Inc.
> > johnm at klir.com
> > 206.902.2027
More information about the memcached