473,405 Members | 2,310 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,405 software developers and data experts.

Optimizing MySQL

Hello all,

can someone advice me some links/infos on how to optimize MySQL server to
execute very complex queries ?
My configuration is as follows : P4 2.8Ghz/512MB running on Fedora Core 1
with latest updates, 2xHDD 36Gb SCSI 10000rpm (RAID 1), MySQL 4.0.22
configured with my-large.cnf, frontend application written in PHP 4.
I need to execute complex queries using multiple joins/unions on large
tables (more than 20,000/30,000 records) and the execution time is really
high (it tooks more than 2 minutes to get results).
mysqld configuration is:

[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 256M
max_allowed_packet = 1M
table_cache = 392
sort_buffer_size = 2M
read_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size= 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8

Any advice ?

Cheers,
A.
Jul 23 '05 #1
2 1431
Thanos wrote:
I need to execute complex queries using multiple joins/unions on large
tables (more than 20,000/30,000 records) and the execution time is really
high (it tooks more than 2 minutes to get results).


Do you have indexes in all the columns you are using in the joins and
have you checked that those are used, using EXPLAIN?
Jul 23 '05 #2
Heya Thanos -
sounds like you kicked the server into TABLE SCAN mode.
Look at your query, any columns in a where clause, a join clause
and go back and index those columns.
Your results time should reduce by 70 percent, from there.
regards [Bill]

--
William Sanders / Electronic Filing Group Remove the DOT BOB to reply via
email.
Mondo Cool TeleCom -> http://www.efgroup.net/efgcog.html
Mondo Cool WebHosting -> http://www.efgroup.net/efglunar.html
Mondo Cool Satellites -> http://www.efgroup.net/sat
VFP Webhosting? You BET! -> http://efgroup.net/vfpwebhosting
mySql / VFP / MS-SQL

"Thanos" <th************@fastwebnet.it> wrote in message
news:ag*******************@tornado.fastwebnet.it.. .
Hello all,

can someone advice me some links/infos on how to optimize MySQL server to
execute very complex queries ?
My configuration is as follows : P4 2.8Ghz/512MB running on Fedora Core 1
with latest updates, 2xHDD 36Gb SCSI 10000rpm (RAID 1), MySQL 4.0.22
configured with my-large.cnf, frontend application written in PHP 4.
I need to execute complex queries using multiple joins/unions on large
tables (more than 20,000/30,000 records) and the execution time is really
high (it tooks more than 2 minutes to get results).
mysqld configuration is:

[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 256M
max_allowed_packet = 1M
table_cache = 392
sort_buffer_size = 2M
read_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size= 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8

Any advice ?

Cheers,
A.

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jackson Miller | last post by:
I need to have a web application be able to import large amounts of data (400,000 rows of 10 columns). I know how to script it and have it running in the background. However I want to know how I...
0
by: Apollo | last post by:
1.2Ghz Pentium, with 1/2Gig of ram, 4.0.14MySQL, RedHat9.0 I have about 20K records that result from the following query. Front end for the database is ACCESS97 and pulling up 20K records makes a...
0
by: gord barq | last post by:
I have this query which does a left outer join and it takes forever (like half a day). Here are the results of an explain analysis. mysql> explain SELECT count(searchresult.title) AS number,...
0
by: Joseph Norris | last post by:
Group, I have been working with Mysql for about 5 years - mainly in LAMP shops. The tables have been between 20-100 thousand records size. Now I have a project where the tables are in the...
0
by: Soefara | last post by:
Dear Sirs, I am experiencing strange results when trying to optimize a LEFT JOIN on 3 tables using MySQL. Given 3 tables A, B, C such as the following: create table A ( uniqueId int not...
0
by: Eric B. | last post by:
Hi, I'm somewhat new to MySql. I've been using it for a while, but pretty much out of the box setup, and am starting to suffer heavily with my larger tables. I have a table with 5,000,000+...
2
by: Fabien Penso | last post by:
Hi. I need a little help to optimize requests on a table, and I have no idea how to do it (I optimized already a lot other table, but this one is a pain). My table looks like : CREATE TABLE...
4
by: Got2Go | last post by:
Hello Group, I have a table that has millions of records in it. About 100 records are added every 5 minutes (one per OIDID) (the sample provided below has data for 2 OIDIDs (99 and 100) And I...
5
by: TristaSD | last post by:
Hi, I wrote a php+MySQL-based reservations system for a local restaurant. MySQL is running on AMD Athlon 3000+ 2GHz with 1.5Gb of RAM. The system is accessed through Intranet by 4-5 machines. ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.