Re: Strategy needed for picking random rows
Thank you Rick,
I have a few questions on your comments:
You said that the LIMIT needs to be in the subselect. However, that is not possible, because almost always I have to add one or two more (unindexed) criteria like haircolor etc. to the outer select. Is there any way around this problem, or is it okay then to leave the LIMIT in the outer query?
You said that Id needs to be part of the index, excpet it is an innodb primary key. The table is innodb, but it's not the primary key. Howver, the explain seems not to be missing anything. Why (and where) do I need the Id in the index?
I will eventually try your second rnd suggestion and get back to you, if that's okay.
Subject
Views
Written By
Posted
3326
September 07, 2011 11:27AM
1389
September 08, 2011 01:08AM
1166
September 08, 2011 01:17AM
1138
September 08, 2011 07:51AM
Re: Strategy needed for picking random rows
1208
September 08, 2011 08:05AM
1163
September 09, 2011 08:51AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.