Hi,
The problem here is that your query says
YEAR(dob) IN (...)
The query optimisations for partitioning uses the same mechanisms to
discover partitions to use as is used to discover usable indexes.
If there was an index on dob MySQL would still not be able to make
the translation. This would require support for functional indexes.
It's quite clear that this is a very useful feature and such features
usually make it into a release eventually but unsure at the moment
which it will be.
Rgrds Mikael
Jonathan Krier Wrote:
-------------------------------------------------------
> Hi,
>
> According to the official documentation (18.4.
> Partition Pruning), with a range partitionning of
> years, this kind of query should benefit of
> pruning :
>
> SELECT * FROM t2 WHERE YEAR(dob) IN (1979, 1980,
> 1983, 1985, 1986, 1988);
>
> However, when I use something like "WHERE
> YEAR(myDateField) = xxx", every partition is
> checked.
>
> Is it a current limitation ?
>
>
> Regards
> Jonathan
Mikael Ronstrom
Senior Software Architect, MySQL AB
My blog:
http://mikaelronstrom.blogspot.com