MySQL Forums
Forum List  »  Performance

Re: Time performance in query Inner Join
Posted by: angel rivero
Date: July 11, 2011 03:01AM

Ok, start over.

===== SHOW CREATE TABLE _tbl1
Table	Create Table
CREATE TABLE `_tbl1` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `CFT_Cod` varchar(255) DEFAULT NULL,
  `CDI` varchar(255) DEFAULT NULL,
  `BT` decimal(10,2) DEFAULT NULL,
  `sec` decimal(10,2) DEFAULT NULL,
  `Art` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `CFT_Cod` (`CFT_Cod`),
  KEY `CDI` (`CDI`),
  KEY `BT` (`BT`),
  KEY `sec` (`sec`),
  KEY `Art` (`Art`)
) ENGINE=InnoDB AUTO_INCREMENT=3665958 DEFAULT CHARSET=latin1;


===== SHOW TABLE STATUS LIKE '_tbl1'
Name = _tbl1	
Engine = InnoDB	
version = 10	
Row_format = Compact	
Rows = 3666243	
Avg_row_length = 210	
Data_length = 771751936	
Max_data_length = 0	
Index_length = 874053632	
Data_free = 1432354816	
Auto_increment = 3665959	
Create_time = 3/3/2011 16:51:51
Collection = latin1_swedish_ci


===== SHOW VARIABLES LIKE '%buffer%'; 
Variable_name			Value
bulk_insert_buffer_size		8388608
innodb_buffer_pool_size		1677721600
innodb_log_buffer_size		2097152
join_buffer_size		131072
key_buffer_size			57671680
myisam_sort_buffer_size		72351744
net_buffer_length		16384
preload_buffer_size		32768
read_buffer_size		65536
read_rnd_buffer_size		262144
sort_buffer_size		262144
sql_buffer_result		OFF


===== EXPLAIN SELECT '_tbl1'....
EXPLAIN SELECT
  `ID` ,
  `CFT_Cod`,
  `CDI`,
  `BT` ,
  `sec` ,
  `Art`
FROM _tbl1

id = 1	
select_type = SIMPLE	
table = _tbl1	
type = ALL	
possible_keys
key
key_len	ref
rows = 3666243	
Extra

****************************************************************************

===== SHOW CREATE TABLE _tbl2
Table	Create Table
CREATE TABLE `_tbl2` (
  `CFT_Cod` varchar(255) DEFAULT NULL,
  `MCR_Cod` varchar(255) DEFAULT NULL,
  `MCR_Clt` int(11) DEFAULT NULL,
  `MCR_Den` varchar(255) DEFAULT NULL,
  `CLIENTIES` int(11) DEFAULT NULL,
  `xID` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`xID`),
  KEY `CFT_Cod` (`CFT_Cod`),
  KEY `CLIENTIES` (`CLIENTIES`)
) ENGINE=InnoDB AUTO_INCREMENT=9290 DEFAULT CHARSET=latin1;

===== SHOW TABLE STATUS LIKE '_tbl2'
Name = _tbl2
Engine = InnoDB	
Version = 10	
Row_format = Compact	
Rows = 9395	
Avg_row_length = 392	
Data_length = 3686400	
Max_data_length = 0	
Index_length = 1310720	
Data_free = 1432354816	
Auto_increment = 9291	
Create_time = 20/6/2011 14:43:38			
Collation = latin1_swedish_ci

===== SHOW VARIABLES LIKE '%buffer%'; 
Variable_name			Value
bulk_insert_buffer_size		8388608
innodb_buffer_pool_size		1677721600
innodb_log_buffer_size		2097152
join_buffer_size		131072
key_buffer_size			57671680
myisam_sort_buffer_size		72351744
net_buffer_length		16384
preload_buffer_size		32768
read_buffer_size		65536
read_rnd_buffer_size		262144
sort_buffer_size		262144
sql_buffer_result		OFF

===== EXPLAIN SELECT '_tbl2'....
EXPLAIN SELECT
  `CFT_Cod`
 ,`MCR_Cod`
 ,`MCR_Clt`
 ,`MCR_Den`
 ,`CLIENTIES`
 ,`xID`
FROM _tbl2;

id = 1	
select_type = SIMPLE	
table = _tbl2	
type = ALL	
possible_keys
key
key_len	ref
rows = 9292
Extra

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Time performance in query Inner Join
942
July 11, 2011 03:01AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.