简体   繁体   中英

Mysql issue with the performance tuning

Folks

I am currently working on a telecom project and processing CDR ( call details records) files and based on that im generating the reports.Records i get per day is about 4 million records and per month its about 90 million avg.we are using mysql database and running stored procedures to process the records. The problem is we are facing the performance issues with running the queries . queries are taking about 4 mins to process and fetch the result.

The server RAM is 4GB.

My concern is

is the RAM that we are using is enough for this sort of project

I would like some serious DBA advice here.

RAM is typically a bottleneck for database servers, BUT not necessarily the biggest. It is important to really understand the reason for a query to be slow. Now given that there are 90 million records, it is safe to say that having the right indexes on the table is important. In addition without knowing the specifics of the query, it would be hard to guess why it is slow. Another area to think about is the number and types of joins in your query. The "simpler" the query (fewer joins), usually this would speed up the query.

Ultimately, though I would do an explain on the query to look at the various stages to see where the slowness comes from. I would start here to understand how to optimize the query:

http://dev.mysql.com/doc/refman/5.0/en/using-explain.html

RAM cannot be the only constraint here. You need to have proper database design, server configuration and indexing too.

If you are only processing the data to fetch reports, use MyISAM engine (if not using already).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM