MySQL Forums
Forum List  »  Optimizer & Parser

Re: querying time is too high
Posted by: trinath somanchi
Date: June 29, 2006 12:48AM

Hi,

---Can you provide the table structure of the usr_tbl table along with the output of EXPLAIN?

This is the table structure

+--------------------------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------------------+---------------+------+-----+---------+-------+
| username | varchar(25) | | PRI | | |
| id | varchar(50) | | PRI | | |
| date | timestamp(14) | YES | PRI | NULL | |
| backup_date | varchar(14) | YES | | NULL | |
| batch_id | int(6) | YES | | NULL | |
| legacy_flag | char(1) | YES | | NULL | |
| total_items | int(9) | YES | | NULL | |
| total_results | int(9) | YES | | NULL | |
| total_income | int(9) | YES | | NULL | |
| gross_income | decimal(10,3) | YES | | NULL | |
| good_items | decimal(10,3) | YES | | NULL | |
| rev_share | decimal(5,2) | YES | | NULL | |
| turnover | decimal(10,3) | YES | | NULL | |
| us_income | int(9) | YES | | NULL | |
| nonus_inc | int(9) | YES | | NULL | |
| unique_item | int(9) | YES | | NULL | |
| unique_item_income | int(9) | YES | | NULL | |
| salefilter_options | varchar(255) | YES | | NULL | |
| sale_err_ab | int(9) | YES | | NULL | |
| sale_err_timeout | int(9) | YES | | NULL | |
| sale_err_rb | int(9) | YES | | NULL | |
| sale_err_nc | int(9) | YES | | NULL | |
| sale_err_db | int(9) | YES | | NULL | |
| sale_err_vl | int(9) | YES | | NULL | |
| sale_err_mip | int(9) | YES | | NULL | |
| sale_err_ipm | int(9) | YES | | NULL | |
| sale_err_apr | int(9) | YES | | NULL | |
| sale_err_other | int(9) | YES | | NULL | |
| sale_err_bur | int(9) | YES | | NULL | |
| err_count | float(4,2) | YES | | 0.00 | |
| total_time | float(6,2) | YES | | 0.00 | |
| sale_count | int(9) | YES | | 0 | |
+--------------------------+---------------+------+-----+---------+-------+



The EXPLAIN TABLE result is

+------------------------------+------+---------------+------+---------+------+----------+-----------------------------+
| table | type | possible_keys | key | key_len | ref | rows | Extra |
+------------------------------+------+---------------+------+---------+------+----------+-----------------------------+
| usr_tbl | ALL | NULL | NULL | NULL | NULL | 16605846 | where used; Using temporary |
+------------------------------+------+---------------+------+---------+------+----------+-----------------------------+

---Have you tried running OPTIMIZE and ANALYZE on the table before running the query?

I dont think optimize and analyze are useful in this case.


---Since you are doing a GROUP BY what is the size of your sort_buffer_size variable?

2097144


Please help me how can I optimize the query.

Thanks in Advance,

--
Trinath somanchi.

--
Trinath Somanchi,
( http://www.myospages.com ).

Options: ReplyQuote


Subject
Views
Written By
Posted
2877
June 27, 2006 07:31AM
1951
June 28, 2006 10:00AM
Re: querying time is too high
1908
June 29, 2006 12:48AM
1912
June 29, 2006 08:52AM


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.