Skip to content

Instantly share code, notes, and snippets.

@lsiden
Created July 20, 2012 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lsiden/3150634 to your computer and use it in GitHub Desktop.
Save lsiden/3150634 to your computer and use it in GitHub Desktop.
Impossible WHERE noticed after reading const tables
-- MySQL dump 10.11
--
-- Host: localhost Database: demo
-- ------------------------------------------------------
-- Server version 5.0.96
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `A`
--
DROP TABLE IF EXISTS `A`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `A` (
`id` int(11) NOT NULL auto_increment,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=126 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `A`
--
LOCK TABLES `A` WRITE;
/*!40000 ALTER TABLE `A` DISABLE KEYS */;
INSERT INTO `A` VALUES (23),(24),(25),(26),(27),(28),(29),(30),(32),(33),(34),(35),(36),(37),(41),(42),(43),(44),(45),(46),(47),(48),(49),(50),(51),(52),(53),(54),(55),(56),(57),(58),(59),(64),(65),(66),(67),(68),(69),(70),(71),(72),(73),(74),(75),(76),(77),(78),(79),(80),(81),(82),(83),(84),(85),(86),(87),(88),(89),(90),(91),(92),(93),(94),(95),(96),(97),(98),(100),(101),(102),(103),(104),(105),(106),(107),(108),(109),(114),(115),(119),(120),(121),(122),(123),(124);
/*!40000 ALTER TABLE `A` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `B`
--
DROP TABLE IF EXISTS `B`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `B` (
`A_id` int(11) NOT NULL,
`B_id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `B`
--
LOCK TABLES `B` WRITE;
/*!40000 ALTER TABLE `B` DISABLE KEYS */;
INSERT INTO `B` VALUES (23,10),(23,13),(25,11),(32,11),(32,14),(33,14),(35,11),(46,1),(46,13),(47,10),(47,13),(51,10),(51,13),(55,10),(55,11),(57,10),(57,11),(59,10),(65,10),(70,11),(71,13),(71,18),(72,13),(72,18),(73,13),(73,18),(74,13),(74,18),(75,13),(75,18),(76,13),(76,18),(79,11),(79,18),(80,18),(81,10),(82,10),(85,11),(85,13),(85,18),(86,13),(86,14),(86,18),(89,10),(89,13),(93,8),(93,10),(93,13),(94,8),(94,10),(94,11),(94,13),(95,8),(96,8),(106,11),(106,19),(114,18),(119,11),(119,13),(120,11),(121,13),(122,13),(123,13),(124,13);
/*!40000 ALTER TABLE `B` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2012-07-20 8:54:27
EXPLAIN SELECT `A`.`id`
FROM `demo`.`A` AS `A`
INNER JOIN `demo`.`B` AS `B` ON ( `A`.`id` = 'B.A_id' )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment