473,387 Members | 1,416 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,387 software developers and data experts.

Configure mysql to compensate for bad structure/queries

Hi all,

So I've been thrown into developer hell, with the assignment "Here's
$formerprogrammers's project, it doesn't work, fix it, oh yeah, and
there's a tight deadline"

It seems like $formerprogrammer knew just enough about php/mysql to
write a working product on a REALLY bad design. Not surprisingly our
company/client decided to jump write into the terrible design and
there's a lot of important data tied up in a terrible structure.

To give an idea, we've got roughly 4 tables of "equipment' each with
between 100,000 and 500,000 records that are between 10 and 15 fields
long. Certain fields are of variable length (model number from
different suppliers) and need to be searched on with wildcards.

My conundrum is this, the existing database design has to stay, there
are roughly 80,000 lines of just as poorly written php code that
somehow manage to execute on top of this structure and need to continue
doing that until I redesign the system. However our main issue with
this tool is speed, a cacophony of sql queries need to run to make
things work, thus bogging down mysql. I'm not too familiar with
configuring mysql, and I've done my best to make this run efficiently
by increasing key_buffer_size and innodb_buffer_pool_size however it
seems no matter how large I set these (currently both at 256M) I still
get hundreds of slow queries (over 10s) per day.

Obviously the end goal is to redesign properly, but until then is there
anything that can be done in my.cnf to handle poorly written queries
running on a lot of data?

Thanks

Jun 27 '06 #1
1 1296
th*********@gmail.com wrote:
I've done my best to make this run efficiently
by increasing key_buffer_size and innodb_buffer_pool_size however it
seems no matter how large I set these (currently both at 256M)
So you have a mix of MyISAM tables and InnoDB tables? Are you aware
that key_buffer_size is relevant only for MyISAM, and innodb_* options
are relevant only for InnoDB tables?
Obviously the end goal is to redesign properly, but until then is there
anything that can be done in my.cnf to handle poorly written queries
running on a lot of data?


Read about the query cache, that's the only thing I can suggest without
knowing more about the project -- which I definitely do *not* want to
know any more about. ;-)

http://dev.mysql.com/doc/refman/5.0/en/query-cache.html

Good luck with the project.

I've had assignments like that. I spent about 75% of my time keeping
the old system operating, until I could identify a few key areas where a
few well-placed shell scripts could automate some clunky tasks well
enough to give me back some of the hours of the day. Then I could make
progress redesigning the system.

Make sure your managers understand that they're asking you to split your
time between _three_ jobs, any of which can be a full-time endeavor:
1. Operator of the ugly, fragile, old system.
2. Design, implement, and test a new system that does everything the old
system does, but better.
3. Migrate all the live data from the old system to the new system,
handling any data mapping, transformations, etc. You need to automate
this with scripts and test thoroughly, so that when the day comes, you
can cut over with a few hours of downtime.

Also make sure they understand that zero downtime during the final
cutover is not a practical goal. In theory it is possible, but usually
involves so much meticulous testing that it isn't worth the additional
effort. In other words, would they like 6 hours of downtime on some
Sunday, or would they like the project to be completed 3 months later?

Regards,
Bill K.
Jun 27 '06 #2

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

Similar topics

3
by: James | last post by:
HI, I'm looking for a script that will allow users/admins to have a one click backup solution for a MYSQL Database.. 'BACK DATABASE' button, click and its done... The a restore option, that...
5
by: glakk | last post by:
I have a problem of migrating a database from one host to another. I can't do a dump on the source server. The only access I have is thru queries. So it looks like I'm going to have to query all...
9
by: Bob Bedford | last post by:
Where to find a comprehensive document on how take datas from XML and put them in a Mysql Database. I've many sites sending us XML files. We have to parse datas and save those datas on Mysql. ...
0
by: Philip Stoev | last post by:
Hi all, Please tell me if any of this makes sense. Any pointers to relevant projects/articles will be much appreciated. Philip Stoev http://www.stoev.org/pivot/manifest.htm ...
16
by: MLH | last post by:
Using MS Access, I have attached to MySQL servers in other states and other countries on the other side of my router. But when I use the MySQL ODBC driver 3.51 to connect to a MySQL server on my...
8
by: Fred | last post by:
Hello, Our website is currently developed in ASP/Mysql 4. The dedicated servers on which it is currently hosted arrive at saturation. Here is their configuration: - 1 server PIV 2,8Ghz 1GB...
39
by: windandwaves | last post by:
Hi Folk I have to store up to eight boolean bits of information about an item in my database. e.g. with restaurant drive-through facility yellow windows
7
by: Randy | last post by:
Folks: We have a web-based app that's _really_ slowing down because multiple clients are writing their own private data into a single, central database. I guess the previous programmer did...
13
by: Ciaran | last post by:
Hi All, Is it faster to have mySql look up as much data as possible in one complex query or to have php do all the complex processing and submit lots of simple queries to the mysql database? ...
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:
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.