-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from macbre/index-digest-sql-log
Add "index-digest-sql-log" option
- Loading branch information
Showing
5 changed files
with
66 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CREATE TABLE `0002_queries_not_using_indices` ( | ||
`item_id` int(9) NOT NULL AUTO_INCREMENT, | ||
`foo` varchar(16) NOT NULL DEFAULT '', | ||
`bar` varchar(16) NOT NULL DEFAULT '', | ||
PRIMARY KEY (`item_id`), | ||
KEY `bar_idx` (`bar`) | ||
); | ||
|
||
INSERT INTO 0002_queries_not_using_indices VALUES | ||
(1, 'test', ''), | ||
(2, 'foo', 'test'), | ||
(3, 'foo', 'check'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
-- these use index | ||
SELECT item_id FROM 0002_queries_not_using_indices WHERE item_id = 2; | ||
SELECT item_id FROM 0002_queries_not_using_indices WHERE item_id BETWEEN 1 AND 3; | ||
SELECT item_id FROM 0002_queries_not_using_indices WHERE foo = "test" AND item_id = 1; | ||
-- these do not use index | ||
SELECT item_id FROM 0002_queries_not_using_indices WHERE foo = "test" OR item_id > 1; | ||
SELECT item_id FROM 0002_queries_not_using_indices WHERE foo = "test" | ||
-- no matching row in const table (#44) | ||
SELECT foo FROM 0002_queries_not_using_indices WHERE item_id = 5; | ||
-- #148: EXPLAINS' Extra says "No tables used" | ||
SELECT 1*1; | ||
SELECT 1 AS one FROM dual WHERE exists ( SELECT item_id FROM 0002_queries_not_using_indices WHERE foo = "test" ); | ||
|