Thanks very much to all who suggest me to use a JOIN
instead of the IN clause, which performances are very poor vs
join ones, as I read in
http://www.artfulsoftware.com/infotree/queries.php#568:
Both the |IN()| and |EXISTS()| queries have to execute a table scan
for each row in the
Hi,
can someone could explain where are problems in this query:
EXPLAIN
SELECT ID
FROM ven_tes
WHERE ID IN (SELECT ID FROM ven_tes WHERE ID_ven=6573)
+++-+-++-+-+--+--+--+
| id |
in mysql sub queries dont perform well.
You can could try this
SELECT a.ID
FROM ven_tes a, ven_tes b where a.id=b.id and b.id_ven=6573 .
On 5/20/08, Wakan [EMAIL PROTECTED] wrote:
Hi,
can someone could explain where are problems in this query:
EXPLAIN
SELECT ID
FROM ven_tes
WHERE
We use a sub select on a 8M+ row table because it takes better advantage
of indexes.
SELECT startip,endip FROM geodb a
WHERE a.startip = (SELECT max(startip) FROM geodb WHERE b.startip =
3250648033) AND a.endip = 3250648033;
startip and endip are INT(10) unsigned and unique keys.
This
On Tue, May 20, 2008 at 7:05 AM, Wakan [EMAIL PROTECTED] wrote:
can someone could explain where are problems in this query:
EXPLAIN
SELECT ID
FROM ven_tes
WHERE ID IN (SELECT ID FROM ven_tes WHERE ID_ven=6573)
If that subselect only returns a single result, try using = instead of
IN. MySQL
On Tue, May 20, 2008 at 11:33 AM, Perrin Harkins [EMAIL PROTECTED] wrote:
If that subselect only returns a single result, try using = instead of
IN. MySQL performed very poorly on OR queries before version 5. It
would avoid using indexes. The new index merge stuff in version 5
fixed that.