473,382 Members | 1,238 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Performance question regarding GROUP BY...

bleurose
We have a modestly large MySQL application (about 10,000,000 rows spread over 40+ tables). Most of our queries are very small and fast (single table or two-table joins with good keys and indexes).

However, we have a few queries that would be described as "long-running", and in particular, they use GROUP BY to aggregate some information. It seems that whenever the query has a GROUP BY, MySQL writes a temp table which then, in turn, puts all other queries into a locked state untl the long-running query finishes. We have tried to simplify the big queries, but as long as the GROUP BY is used, the query plan still shows the temp table being written and then in practice, the locking occurs (BTW, this uses MyISAM, but we tried InnoDB as well in a test, and although it didn't "lock" the other queries, instead it put them into "sleep" and the results were the same). This causes most of our short queries to wait for a long time, which is unacceptable.

It is perfectly okay for the long query to run a REALLY long time as long as it doesn't create an obstacle for the other queries. And this query does NO writing to the database tables themselves, it is only the temp table that is being written.

I have used many other databases and this situation (a temp table being written from a purely read-only query causing other read-only short queries to lock) has never occurred (including Postgres, Oracle, DB2, SQL Server, etc.) I can't believe other MySQL users don't use GROUP BY and I assume we must be missing something really dumb.

Please enlighten us if you can. Is there a way to get rid of the temp table which causes this performance problem without completely rewriting our app?

Thanks!
Feb 2 '08 #1
0 1318

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ed Wong | last post by:
I am looking for some published paper regarding database performance tunning performance strategies. This is for academic purpose so it needs not to be any commerical database specific. It will...
3
by: Dick Zeeman | last post by:
Hi, I have a problem regarding the perfomance of a stp in combination with character translation. The following happens. We have an automated installation script (nt command file) for...
133
by: Gaurav | last post by:
http://www.sys-con.com/story/print.cfm?storyid=45250 Any comments? Thanks Gaurav
0
by: jaggee | last post by:
Hello, This is regarding log analysis of a web system, I am finding my backend SQL programming has taken so much of time to process the application due to following quires for a log table having...
1
by: Ashish | last post by:
hi all, Iam trying to investigate some serious memory problems and ways to optimize them in our web application. some of the information i collected using the performance monitor, is that ...
7
by: Peter Ritchie | last post by:
I'm writing a Web Service and I would like to add performance counter data for monitoring performance of the Web Service's operations over time and load. The problem is, I get the "Requested...
5
by: sp | last post by:
Hello I have a problem with the refresh performance in datagrid – when datagrid is being shown it is so slow that I can see one by one cells is drawn -datagrid contains about 35x40 of...
8
by: NAdir | last post by:
Hi, thank you for your help. My VB.Net application contains a document that the user can refresh at any time. The refresh works fine and needs to loop through few datatables (hundreds of rows)....
1
by: ianwr | last post by:
Hi, I wondered in anyone can help with the following problem that i'm experiencing, i'll try to provide as much info as possible and any suggestions would be appreciated. I have just started...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.