If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > JOIN rows produced vs rows read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-04-05, 06:29
codenode codenode is offline
Registered User
 
Join Date: Dec 2004
Posts: 26
JOIN rows produced vs rows read

On a 3 table join where MySQL predicts rows for each table to be 10-2-1 (tables A-B-C; type index-ref-eq_ref) the total rows produced is the product of these values, 20.

However, isn't the number of rows read (i.e., individual rows fetched by MySQL to construct the joined rows) 50: 10 from table A, plus 2 for each of these 10, plus 1 for each of combination of B and A?

Thanks.
Reply With Quote
  #2 (permalink)  
Old 01-04-05, 09:24
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
actually i think the number of rows read is 13
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 01-04-05, 14:05
codenode codenode is offline
Registered User
 
Join Date: Dec 2004
Posts: 26
Regarding eq_ref for example the manual says "One row will be read from this table for each combination of rows from the previous tables." I took 'each combination ...' to mean like A1-B1, A1-B2, A1-B3, etc. ?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On