Re: Index merge optimization (with OR) and table joins

2006-05-23 Thread Stuart Brooks
Thanks for the reply, it's much appreciated. I'll have another look at the tables, although my criteria were such that the query should have only returned a tiny fraction (<0.1%) of the rows (which is why I was confused). If I get any closer to a solution I'll try and post with a bit more info. An

Re: Index merge optimization (with OR) and table joins

2006-05-04 Thread sheeri kritzer
On 5/4/06, sheeri kritzer <[EMAIL PROTECTED]> wrote: (again, apologies for the lateness...) MySQL has a cost-based optimizer. If it's deciding that a full-table scan is appropriate, there's a reason. If more than 30% (approx) of the table would be returned in a range query, the optimizer reaso

Re: Index merge optimization (with OR) and table joins

2006-05-04 Thread sheeri kritzer
(again, apologies for the lateness...) MySQL has a cost-based optimizer. If it's deciding that a full-table scan is appropriate, there's a reason. If more than 30% (approx) of the table would be returned in a range query, the optimizer reasons that it's LESS expensive to just do a full table sc

Index merge optimization (with OR) and table joins

2006-04-11 Thread Stuart Brooks
Hi, I have been having a hassle getting the index_merge to work as expected when I am joining 2 tables on MySQL 5.0.19. The following example should make it clear: Table A key1 (primary key) key2 some_data Table B key1 (indexed) key2 (indexed) more_data SELECT a.key1,a.key2,b.more_d