MySQL

Is there a performance difference between the f...

Multiple choice question

Is there a performance difference between the following two queries applied on the table below?
Query 1:

SELECT a.id, SUM(a.flags) AS flags FROM tbl a INNER JOIN (SELECT DISTINCT id FROM tbl WHERE (7&flags) ) AS b USING (id) GROUP BY id DESC;

Query 2:

SELECT a.id, SUM(a.flags) AS flags FROM tbl a Join tbl b USING (id) WHERE (7&b.flags) GROUP BY a.id DESC;

Given the following table:

id flag text
1 1 some text 1
1 2 some text 2
2 4 some text 3
3 1
3 8

How to force MySQL full scan a table

Multiple choice question

How can you force MySQL to full scan a table (meaning force MySQL to ignore all indexes and choose to full scan the table in order to execute the given query)?

Syndicate content