Hi Jun,

On 12/22/06, Jun Martin <[EMAIL PROTECTED]> wrote:

Now can you tell me why selecting data from a few tables in a mysql
database (being used daily by tellers posting payments and new bills
getting posted by the thousands daily) usually takes 20 minutes but
takes only 4 minutes when the mysql service has been restarted less than
one (1) day prior to the query?


I've had prior experience with MySQL which may point you towards
optimizing your query or coming up with the appropriate indexes (or
both).

What you can do is look at the queries that get run most often and
with the most results, and decide whether you can bear the extra space
that indexes will help you out with. For example, if you have a query
like:

 SELECT * FROM my_table WHERE some_field='some_value' ;

And it's taking you a while to get the results, you might want to
index my_table on some_field. This has proven (at least with previous
experience with MySQL on considerably large tables) to be very helpful
when it comes to optimizing the speed of queries.

Of course there are other ways, like de-normalizing your tables if you
have many joins in your queries and simple(r) things like using faster
drives, more memory, faster processors.

Really depends on your particular requirements and system.

Sounds like you need a consultant to help you optimize your systems...
There are a lot of people here (not me included) who would love to
help you out if the price is right. ;)

HTH!

--
Dean Michael C. Berris
http://cplusplus-soup.blogspot.com/
mikhailberis AT gmail DOT com
+63 928 7291459
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph

Reply via email to