List:Internals« Previous MessageNext Message »
From:Andy Bennett Date:May 14 2009 1:06pm
Subject:[Fwd: Re: Handling of keypart_map in custom storage engine]
View as plain text  

-------- Original Message --------
Subject: Re: Handling of keypart_map in custom storage engine
Date: Thu, 14 May 2009 10:53:01 +0100
From: Andy Bennett <andyjpb@stripped>
To: Vyacheslav Akhmechet <coffeemug@stripped>
References: <b381ea40905131614l4ebf4a85t5b1c345a2d7878ed@stripped>

Hi,

> When the server calles index_read and related functions, it passes
> keypart_map which indicates which parts of the key are present. I'm
> not completely sure how to handle the implementation of this - if the
> semantics of keypart_map are such that any of the bits may be set or
> unset, I don't know how an efficient implementation can be possible.
> 
> Suppose a given key has two parts, A and B, and I build an index on
> this key (by combining A and B in lexicographic order, or a similar
> technique). Now, suppose index_read is called, and part A is missing
> from the key. In this case the index is essentially useless - I need
> to do a full table scan. I don't see how one could implement an index
> to get around this.
> 
> Am I misunderstanding the purpose/semantics of keypart_map?

It is my understanding that currently only key prefixes are supported.

See the "Parsing Key Information section at
http://forge.mysql.com/wiki/MySQL_Internals_Custom_Engine#Supporting_Indexing

So, with reference to your example, if B is set then A must also be set.
However, A can be set without B being set.



Regards,
@ndy




Regards,
@ndy

-- 
andyjpb@stripped
http://www.ashurst.eu.org/
http://www.gonumber.com/andyjpb
0x7EBA75FF






Regards,
@ndy

-- 
andyjpb@stripped
http://www.ashurst.eu.org/
http://www.gonumber.com/andyjpb
0x7EBA75FF

Thread
[Fwd: Re: Handling of keypart_map in custom storage engine]Andy Bennett14 May