Bug #8414 | SQL Engine refuses to use index on first table of outer query when subselect | ||
---|---|---|---|
Submitted: | 10 Feb 2005 4:35 | Modified: | 8 Apr 2005 23:54 |
Reporter: | Dan Tomlinson | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 4.1.9 | OS: | Linux (Fedora Core 3) |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[10 Feb 2005 4:35]
Dan Tomlinson
[10 Feb 2005 4:52]
Dan Tomlinson
This was tested against both InnoDB and MyIsam table types.
[18 Feb 2005 21:31]
Jorge del Conde
Hi Can you send me the create statement of the tables that you used to reproduce this behaviour ? Thanks.
[22 Feb 2005 15:09]
Dan Tomlinson
Sorry for the delay, I was out of town for a few days. Schema creation was: DROP TABLE IF EXISTS subcustnote; CREATE TABLE subcustnote ( cus_id int(11) unsigned DEFAULT '0' NOT NULL, note_date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, note_user varchar(8) DEFAULT '' NOT NULL, note_content text, KEY cusbydate (cus_id,note_date) ); DROP TABLE IF EXISTS artrans; CREATE TABLE artrans ( currency char(3) DEFAULT '' NOT NULL, orders_id int(5) DEFAULT '0', cus_id int(5) DEFAULT '0' NOT NULL, cus_terms varchar(12), trandate date DEFAULT '0000-00-00' NOT NULL, product_amount decimal(8,2) DEFAULT '0.00' NOT NULL, freight_amount decimal(8,2) DEFAULT '0.00' NOT NULL, extension decimal(10,2) DEFAULT '0.00' NOT NULL, trantype char(1) DEFAULT '' NOT NULL, tax_amount decimal(8,2) DEFAULT '0.00' NOT NULL, paid_flag char(1), paid_date date, seqnum int(8) NOT NULL auto_increment, applyto int(5), paytype varchar(8), reference varchar(8), PRIMARY KEY (seqnum), KEY artrancus (cus_id,trandate) ); DROP TABLE IF EXISTS subcustomer; CREATE TABLE subcustomer ( cus_id int(11) unsigned NOT NULL auto_increment, cus_fname varchar(20) DEFAULT '' NOT NULL, cus_lname varchar(20) DEFAULT '' NOT NULL, cus_addr1 varchar(30) DEFAULT '' NOT NULL, cus_addr2 varchar(30), cus_city varchar(24) DEFAULT '' NOT NULL, cus_prov char(2) DEFAULT '' NOT NULL, cus_country char(2) DEFAULT 'CA' NOT NULL, cus_postal varchar(14), cus_phone_H varchar(18), cus_phone_B varchar(18), cus_phone_C varchar(16), cus_phone_F varchar(16), cus_email varchar(64) DEFAULT '' NOT NULL, cus_type char(1) DEFAULT 'S' NOT NULL, cus_lchange timestamp(14), cus_followup_flag char(1) DEFAULT 'N' NOT NULL, cus_followup_date date DEFAULT '0000-00-00' NOT NULL, cus_renewal_flag char(1) DEFAULT 'Y' NOT NULL, cus_password varchar(40) DEFAULT '' NOT NULL, cus_extern_id int(11) unsigned, cus_taxlic varchar(10) DEFAULT 'YES' NOT NULL, cus_origin varchar(8), cus_credlim smallint(6) DEFAULT '500' NOT NULL, cus_allowcred char(1) DEFAULT 'Y' NOT NULL, cus_storename varchar(35), cus_prefship varchar(8), cus_prefterm varchar(6), ccoflog_id int(6), cus_mailerror char(1) DEFAULT 'N' NOT NULL, cus_created date, cus_hadstanding char(1) DEFAULT 'N' NOT NULL, cus_lastcancel varchar(30), cus_minshipqty smallint(6) DEFAULT '1' NOT NULL, cus_firm_sor char(1) DEFAULT 'F' NOT NULL, cusprofile set('0','99','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19'), cus_has_rack char(1) DEFAULT 'N' NOT NULL, PRIMARY KEY (cus_id), UNIQUE nodupcust (cus_phone_H,cus_lname,cus_fname), KEY cusbydate (cus_created,cus_id) );
[8 Mar 2005 0:58]
Dan Tomlinson
Do I change the status or is this automatic?
[8 Mar 2005 1:07]
Dan Tomlinson
This appears to also be related to 7830?
[8 Apr 2005 23:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[8 Apr 2005 23:54]
Dan Tomlinson
Despite providing feedback I see no change to status.