Re: Need help performance tuning mysql db On 2 May, 16:38, "weheh" <we...@yahoo.com> wrote:
> > The MySQL manual has a lot of good information on tuning.
>
> > But Michael gave you the most important tip. Before you do ANYTHING ELSE,
> > run EXPLAIN on each of your queries. Look at the output and find those
> > which are doing full table scans.
>
> > You can't specify how many queries can be run simultaneously, but you can
> > specify the number of connections which can be active concurrently in your
> > my.ini file.
>
> > But I highly doubt that's your problem. Most likely your problem is
> > inefficient database design and/or inefficient queries.
>
> > And no, MySQL does not lock tables for SELECT statements. What gets
> > locked when you update the database depends on the request and engine
> > being used.
>
> > P.S. Please don't top post. Thanks.
>
> > --
> > ==================
> > Remove the "x" from my email address
> > Jerry Stuckle
> > JDS Computer Training Corp.
> > jstuck...@attglobal.net
> > ==================
> Hi Jerry,
>
> Thanks for your rapid response. Much appreciated. I've read the tuning
> manual at this point and it is full of good suggestions. I've started by
> tinkering with my swap space, but haven't gotten any positive results, yet.
> My server has 4GB of memory but only 1GB is getting used, max.
>
> A few questions:
>
> - I find that my cgi-bin script that does a database access refreshes my
> browser in a herky-jerky fashion. I'll get a bunch of data. Then a long
> pause. Then a bunch of data. Then wait again. Etc. What could be causing
> that?
>
> - My DB tables are all built using CREATE TABLE. Primary tables have keys.
> There are some many to many tables that have no keys. For instance: user is
> member of group that has acess to record of another table that can belong to
> multiple groups. I don't really understand what MYISAM and INNODB are and
> what they can do for me. Do I need to understand that to tune performance?
> My queries seem straightforward and are all done with LEFT JOINs. Nothing
> too fancy.
>
> - Can EXPLAIN be run from within a cgi-bin script? I must learn this
> capability.
>
> Sorry for the top-post.
>
> R
>
> > Richard,
>
Jerry asked you very nicely not to top post and you apologised IN
ANOTHER TOP POST!
Please don't top post. I have fixed the top posting (again).
Now, everyone here has pointed out that you are trying to optimise the
wrong thing. You are looking at the system, before you have optimised
your queries/indexes.
You say that you are "relatively experienced at creating mysql DBs",
yet you seem to be unsure about EXPLAIN and you make a statement like
"My DB tables are all built using CREATE TABLE", as if there was
another way to create a table, so I somehow doubt just how competent
you actually are with RDBMSs.
You say that "Primary tables have keys.", but there are no such things
as "Primary tables". You even admit that "There are some many to many
tables that have no keys." and yet you claim to have optimised the
application!
You need to go away and use EXPLAIN plus knowledge of the data in your
tables and the way the application works to optimise the structure,
indexing and access queries. This is where you will get you
performance gains.
I told you this in the first response to your query and everyone else
has told you the same.
It is now up to you to take the advice we have all offered.
Please stop coming back here and top posting bleats about server size
and other irrelevancies until you have done the basics. |