{EXPLAIN | DESCRIBE | DESC}
tbl_name [col_name | wild]
{EXPLAIN | DESCRIBE | DESC}
[explain_type] SELECT select_options
explain_type: {EXTENDED | PARTITIONS}
DROP TABLE IF EXISTS `products`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; CREATE TABLE `products` ( `products_id` int(11) unsigned NOT NULL auto_increment, `products_type` int(11) unsigned NOT NULL default '1', `products_quantity` float NOT NULL default '0', `products_model` varchar(32) default NULL, `products_upc` varchar(32) default NULL, `products_isbn` varchar(32) default NULL, `products_image` varchar(128) default NULL, `products_image_thumbnail` varchar(200) NOT NULL, `products_price` decimal(15,4) NOT NULL default '0.0000', `products_virtual` tinyint(1) NOT NULL default '0', `products_date_added` datetime NOT NULL default '0001-01-01 00:00:00', `products_last_modified` datetime default NULL, `products_date_available` datetime default NULL, `products_weight` float NOT NULL default '0', `products_status` tinyint(1) NOT NULL default '0', `products_tax_class_id` int(11) NOT NULL default '0', `manufacturers_id` int(11) default NULL, `products_web_id` int(11) default NULL, `products_ordered` float NOT NULL default '0', `products_quantity_order_min` float NOT NULL default '1', `products_quantity_order_units` float NOT NULL default '1', `products_priced_by_attribute` tinyint(1) NOT NULL default '0', `product_is_free` tinyint(1) NOT NULL default '0', `product_is_call` tinyint(1) NOT NULL default '0', `products_quantity_mixed` tinyint(1) NOT NULL default '0', `product_is_always_free_shipping` tinyint(1) NOT NULL default '0', `products_qty_box_status` tinyint(1) NOT NULL default '1', `products_quantity_order_max` float NOT NULL default '0', `products_sort_order` int(11) NOT NULL default '0', `products_discount_type` tinyint(1) NOT NULL default '0', `products_discount_type_from` tinyint(1) NOT NULL default '0', `products_price_sorter` decimal(15,4) NOT NULL default '0.0000', `master_categories_id` int(11) NOT NULL default '0', `products_mixed_discount_quantity` tinyint(1) NOT NULL default '1', `metatags_title_status` tinyint(1) NOT NULL default '0', `metatags_products_name_status` tinyint(1) NOT NULL default '0', `metatags_model_status` tinyint(1) NOT NULL default '0', `metatags_price_status` tinyint(1) NOT NULL default '0', `metatags_title_tagline_status` tinyint(1) NOT NULL default '0', `itemno` varchar(32) default NULL, `products_images_no` varchar(10) default '0', `products_url` varchar(512) default NULL, PRIMARY KEY (`products_id`), UNIQUE KEY `itemno` (`itemno`) ) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `products_image`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; CREATE TABLE `products_image` ( `id` int(10) unsigned NOT NULL auto_increment, `products_id` int(10) unsigned NOT NULL, `products_images_no` varchar(10) default '0', `image_dir` varchar(200) default NULL, `products_image_thumbnail` varchar(200) default NULL, `flag` int(2) default NULL, `up_time` datetime default NULL, `web_from` varchar(20) default NULL, PRIMARY KEY (`id`), KEY `idx_porducts_id` (`products_id`) ) ENGINE=MyISAM AUTO_INCREMENT=1DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client;
mysql> explain select products_id from products limit 1; +----+-------------+----------+-------+---------------+---------+---------+------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+-------+---------------+---------+---------+------+------+-------------+ | 1 | SIMPLE | products | index | NULL | PRIMARY | 4 | NULL | 3113 | Using index | +----+-------------+----------+-------+---------------+---------+---------+------+------+-------------+
mysql> select version(); +------------+ | version() | +------------+ | 5.1.73-log | +------------+ 1 row in set (0.00 sec)
mysql> explain select products_id from products; +----+-------------+----------+-------+---------------+---------+---------+------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+-------+---------------+---------+---------+------+------+-------------+ | 1 | SIMPLE | products | index | NULL | PRIMARY | 4 | NULL | 3113 | Using index | +----+-------------+----------+-------+---------------+---------+---------+------+------+-------------
mysql> explain select products_id from (select * from products limit 10) b ; +----+-------------+------------+------+---------------+------+---------+------+------+-------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+------------+------+---------------+------+---------+------+------+-------+ | 1 | PRIMARY | <derived2> | ALL | NULL | NULL | NULL | NULL | 10 | | | 2 | DERIVED | products | ALL | NULL | NULL | NULL | NULL | 3113 | | +----+-------------+------------+------+---------------+------+---------+------+------+-------+
mysql> explain select products_id from products where products_id=10 union select products_id \ from products where products_id=20 ; +----+--------------+------------+-------+---------------+---------+---------+-------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+--------------+------------+-------+---------------+---------+---------+-------+------+-------------+ | 1 | PRIMARY | products | const | PRIMARY | PRIMARY | 4 | const | 1 | Using index | | 2 | UNION | products | const | PRIMARY | PRIMARY | 4 | const | 1 | Using index | | NULL | UNION RESULT | <union1,2> | ALL | NULL | NULL | NULL | NULL | NULL | | +----+--------------+------------+-------+---------------+---------+---------+-------+------+-------------+
mysql> explain select * from products where products_id in ( select products_id from products where \ products_id=10 union select products_id from products where products_id=20 ); +----+--------------------+------------+-------+---------------+---------+---------+-------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+--------------------+------------+-------+---------------+---------+---------+-------+------+-------------+ | 1 | PRIMARY | products | ALL | NULL | NULL | NULL | NULL | 3113 | Using where | | 2 | DEPENDENT SUBQUERY | products | const | PRIMARY | PRIMARY | 4 | const | 1 | Using index | | 3 | DEPENDENT UNION | products | const | PRIMARY | PRIMARY | 4 | const | 1 | Using index | | NULL | UNION RESULT | <union2,3> | ALL | NULL | NULL | NULL | NULL | NULL | | +----+--------------------+------------+-------+---------------+---------+---------+-------+------+-------------+
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有