Re: [Maria-developers] index_merge, @@sort_buffer_size, and Sort_XXX counters

2011-01-19 Thread Igor Babaev
On 01/19/2011 02:32 PM, Sergey Petrunya wrote: > Hello, > > index_merge uses @@sort_buffer_size as a guide of how much space it can use > for > sorting. I think there is an issue with the way it is done. > > Before index_merge was introduced, @@sort_buffer_size was used only by > filesort (also

[Maria-developers] index_merge, @@sort_buffer_size, and Sort_XXX counters

2011-01-19 Thread Sergey Petrunya
Hello, index_merge uses @@sort_buffer_size as a guide of how much space it can use for sorting. I think there is an issue with the way it is done. Before index_merge was introduced, @@sort_buffer_size was used only by filesort (also for couple of other cases like GROUP_CONCAT with sorting, but I

Re: [Maria-developers] Optimization about count(*) of mysql 5.1.38

2011-01-19 Thread Sergei Golubchik
Hi, Lichao! On Jan 10, Lichao Xie wrote: > hi all: > I have a question about the optimization of count(*) in a range. > Sql for mysql like:select count(*) from t where id > 10 and id < 100; > In table t, there is an B-tree index on id field, this sql will read > hundreds of thousands of record

[Maria-developers] [pser...@askmonty.org: No "Using index" support in sort-intersect - intentional?]

2011-01-19 Thread Sergey Petrunya
Another question: why is type='range' for sort_intersect? We have type=index_merge for intersect and [sort]_union, so it seems rather confusing that we have type=range for sort_intersect? - Forwarded message from Sergey Petrunya - Date: Wed, 19 Jan 2011 11:11:14 +0300 From: Sergey Petru

[Maria-developers] No "Using index" support in sort-intersect - intentional?

2011-01-19 Thread Sergey Petrunya
Hello Igor, I was looking at sort-intersect and noticed the following: Consider this table: CREATE TABLE `t1` ( `k1` int(11) DEFAULT NULL, `k2` int(11) DEFAULT NULL, `filler` char(100) DEFAULT NULL, KEY `k1` (`k1`), KEY `k2` (`k2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; Let's try