Hi Hakan,
On Fri, May 02, 2008 at 11:47:32AM +0200, Hakan Kuecuekyilmaz wrote:
> Sergey,
>
> two questions below,
>
> On Do, 2008-05-01 at 23:32 +0400, Sergey Petrunia wrote:
> > Below is the list of changes that have just been committed into a local
> > 6.0 repository of sergefp. When sergefp does a push these changes
> > will be propagated to the main repository and, within 24 hours after the
> > push, to the public repository.
> > For information on how to access the public repository
> > see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
> >
> > ChangeSet@stripped, 2008-05-01 23:32:15+04:00, sergefp@stripped +9 -0
> > ORDER BY ... LIMIT support for Falcon:
> > - add FalconOrderByLimitHandling code which arranges for Falcon to do
> > ordered index/range scans when SQL layer has LIMIT and ordering.
> >
>
> [cut]
>
>
> > @@ -2737,6 +2739,31 @@ void StorageInterface::decodeRecord(ucha
> > int StorageInterface::extra(ha_extra_function operation)
> > {
> > DBUG_ENTER("StorageInterface::extra");
> > + if (operation == HA_EXTRA_ORDERBY_LIMIT)
> > + {
> > + /*
> > + SQL Layer informs us that it is considering an ORDER BY .. LIMIT
> > + query. It's time we could
> > + 1. start returning HA_READ_ORDER flag from index_flags() calls,
> > + which will make the SQL layer consider using indexes to
> > + satisfy ORDER BY ... LIMIT.
> > + 2. If doing #1, every index/range scan must return records in
> > + index order.
> > + */
> > + fprintf(stderr, "ha_falcon->extra(HA_EXTRA_ORDERBY_LIMIT)\n");
>
> Do we really need a fprintf() here?
The patch is not a finished new feature but only SQL layer's part of the new
feature. The Falcon part is to be done by falcon team, it is a stub which
should be replaced with real code by the Falcon team.
The fprintfs are there because they are the only way one could reliably see
that the SQL layer works with the Falcon-side stub as intended. I suppose
whoever codes the Falcon part will remove them.
If you're running lots of queries and get stderr flooded by these fprintf
(which is odd - the stub isn't a complete implementation, sure queries will
produce wrong results), you can disable my patch by removing
HA_CAN_READ_ORDER_IF_LIMIT from falcon's table flags. Then the code with
fprintfs will never be reached (but there will be nothing to test either
because the code will execute using the exactly same path as before).
BR
Sergey
--
Sergey Petrunia, Lead Software Engineer
MySQL AB, www.mysql.com
Office: N/A
Blog: http://s.petrunia.net/blog