MySQL Forums
Forum List  »  Optimizer & Parser

Re: Optimizing ORDER BY any ideas?
Posted by: Marc Van Olmen
Date: September 08, 2005 08:28AM

Jay,

sorry about the confusion I was thinking you wanted the other big query,

ok here the Explain /G of the original query with ORDER BY:


*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: T_SALES_ORDER_ITEM
type: range
possible_keys: SOI_INDEX,SOI_LNK_PRODUCT
key: SOI_LNK_PRODUCT
key_len: 4
ref: NULL
rows: 3337
Extra: Using where; Using index; Using temporary; Using filesort
*************************** 2. row ***************************
id: 1
select_type: SIMPLE
table: T_PROGRAM_PRODUCT
type: ref
possible_keys: PMP_LNK_PROGRAM,PMP_LNK_CHANNEL,PMP_LNK_PRODUCT
key: PMP_LNK_PRODUCT
key_len: 4
ref: tvplanner4.T_SALES_ORDER_ITEM.SOI_LNK_PRODUCT
rows: 2
Extra: Using where
*************************** 3. row ***************************
id: 1
select_type: SIMPLE
table: T_PROPERTY
type: eq_ref
possible_keys: PRY_LNK_SALES_ORDER_ITEM
key: PRY_LNK_SALES_ORDER_ITEM
key_len: 4
ref: tvplanner4.T_SALES_ORDER_ITEM.SOI_INDEX
rows: 1
Extra:

This query takes about 0.3 to execute


There below the one without the ORDER BY:

*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: T_SALES_ORDER_ITEM
type: range
possible_keys: SOI_INDEX,SOI_LNK_PRODUCT
key: SOI_LNK_PRODUCT
key_len: 4
ref: NULL
rows: 3337
Extra: Using where; Using index
*************************** 2. row ***************************
id: 1
select_type: SIMPLE
table: T_PROGRAM_PRODUCT
type: ref
possible_keys: PMP_LNK_PROGRAM,PMP_LNK_CHANNEL,PMP_LNK_PRODUCT
key: PMP_LNK_PRODUCT
key_len: 4
ref: tvplanner4.T_SALES_ORDER_ITEM.SOI_LNK_PRODUCT
rows: 2
Extra: Using where
*************************** 3. row ***************************
id: 1
select_type: SIMPLE
table: T_PROPERTY
type: eq_ref
possible_keys: PRY_LNK_SALES_ORDER_ITEM
key: PRY_LNK_SALES_ORDER_ITEM
key_len: 4
ref: tvplanner4.T_SALES_ORDER_ITEM.SOI_INDEX
rows: 1
Extra:



Thanks for your input again,

marc

Options: ReplyQuote


Subject
Views
Written By
Posted
4628
September 06, 2005 05:35PM
2567
September 06, 2005 06:39PM
2740
September 06, 2005 08:30PM
2498
September 06, 2005 09:18PM
2492
September 07, 2005 07:10AM
2471
September 07, 2005 06:28PM
2504
September 07, 2005 08:55PM
Re: Optimizing ORDER BY any ideas?
2356
September 08, 2005 08:28AM
2414
September 08, 2005 11:12PM
2451
September 09, 2005 10:00AM
2391
September 09, 2005 10:22AM
2390
September 09, 2005 10:03PM
2591
September 10, 2005 07:30AM
2962
September 10, 2005 09:22AM
2381
September 12, 2005 02:45PM
2350
September 12, 2005 04:41PM


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.