← Back to team overview

maria-developers team mailing list archive

Re: Optimization about count(*) of mysql 5.1.38

 

Hi, Sergei!
I'm sorry, my English is not so good!
There is no a API to get the exact records in a range, but the API can
help to improve performance for the case: select count(*) from t where
id > 10 and id < 1000000;
I want to know why there is no such a API.
Thank you very much!

2011/1/24 Sergei Golubchik <serg@xxxxxxxxxxxx>:
> Hi, Lichao!
>
> On Jan 21, Lichao Xie wrote:
>> >
>> > No, there is no such a API. The best you can do in your engine is to pay
>> > attention to TABLE::read_set and HA_EXTRA_KEYREAD which will allow you
>> > to reduce the amount of work you do per key. But still it will be the
>> > complete range scan - from the lower to the upper boundary or the range.
>>
>> Yes. But I want to know that with this use is based on what consideration?
>> the lock or something else?
>
> I am sorry, I cannot understand you.
> Could you try to rephrase your question please?
>
> Regards,
> Sergei
>



Follow ups

References