[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-internals
Subject:    Re: Hash tables in mysqld
From:       Sergei Golubchik <serg () mysql ! com>
Date:       2006-03-31 14:29:01
Message-ID: 20060331142901.GE28797 () serg ! mylan
[Download RAW message or body]

Hi!

On Mar 31, Eric Prud'hommeaux wrote:
> On Thu, Mar 30, 2006 at 11:43:22PM -0800, Eric Bergen wrote:
> > Eric Prud'hommeaux wrote:
> > >I'm sticking SPARQL support into MySQL (in a big hurry, since
> > >apparently I'm speaking about it at XTech) and need to store lots of
> > >stuff in hash tables for efficient parsing. The List<foo> templates
> > >seem to be used quite a lot, but I haven't got a sense what to use for
> > >hashes. I was looking for something like Hash<foo> but found some HASH
> > >things which behave pretty differently. I need a homogeneous hash
> > >indexed by an arbitrary string. For most of my hashes, the strings can
> > >be 0-terminated. Some can have \0s in them so they need to either be
> > >indexed by (char*, size_t) or just be stuck in a List and I'll worry
> > >about their efficiency later.
> > >
> > >So, what Hash code can I re-use in mysqld?
> > >  
> > mysys/hash.c or sql/hash_filo.cc
> 
> thank you kindly, Eric
> 
> As I understand it, mysys/hash.c (and include/hash.h) provide the HASH
> mentioned above. It works with gptrs (essentially, a void* ?) so c++
> can't do your typechecking. List<foo> is templated so it can work with
> foos directly, allowing c++ to check types. hash_file.cc is a wrapper
> for HASH which maintains info to find (and purge) the
> Least-Recently-Used hash entry.
> 
> Is there any reason not to have a Hash<> template? I'm not going to
> write one now, but I'm just curious what the rationale is.

I don't know any reason not to have it.
Most probably, nobody cared to write one.

Regards,
Sergei

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@mysql.com>
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, Senior Software Developer
/_/  /_/\_, /___/\___\_\___/  Kerpen, Germany
       <___/  www.mysql.com

-- 
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe:    http://lists.mysql.com/internals?unsub=mysql-internals@progressive-comp.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic