Welcome, Guest. [ Log In ]
Question   What does that "ratio" mean on the mysql usage page?
Search KBase

Top 4 in this Area:
1. How many conueries am I allowed per month?
2. Why do connections count so much towards conueries?
3. What does that "ratio" mean on the mysql usage page?
4. How do I check how many conueries I've used?

What does that "ratio" mean on the mysql usage page?
The ratio column gives you the number of queries divided by 25 times the number of connects, and is an indicator of whether you're using a disproportionate number of database connections.

A value of 1 is ideal (meaning 1 connect for every 25 queries). Ratios less than one mean you're using less than 25 queries per connection, an indication of either poor connection management or a particularly simple database. Generally, the higher the ratio, the better your database connection optimization (which is a good thing)

Last updated: Apr 23, 2002.

User Post (2005-09-06 14:37:15 by mechruin)
It is worth noting that on a very simple database, a one to one ratio will be 0.04MCn. You can use this value as a very helpful metric in evaluating how productive you are making each database connection in cases where you have less than 25 queries per page.
User Post (2005-01-19 15:59:54 by nowak)
Any great way to optimize?
User Post (2003-03-12 13:40:08 by inaux)
Date | Disk Usage | Connects | Queries | Conueries | Ratio

2003-03-09 | 6.141 MB | 1388 | 6841186 | 6.876 MCn | 197.152<BR>
2003-03-10 | 5.641 MB | 2596 | 8855168 | 8.920 MCn | 136.443<BR>
2003-03-11 | 7.957 MB | 2435 | 10453508 | 10.514 MCn | 171.721<BR>
2003-03-12 | 6.363 MB | 1479 | 7465854 | 7.503 MCn | 201.916<BR><BR>

Ratio really doesn't have much to do with efficiency, its all based on what type of program you are running... look at my ratio. This is from the database for a game website (obviously with all the fights and such each users make MANY queries).. I'm also using pconnect()
User Post (2002-11-16 06:49:46 by 9632alpha)
How does the calculation of the number of actual conueries work? I'm trying to find a listing somewhere on the site. In a SQL usage warning e-mail I recently received, it's defined as:

# conueries = queries + (connections*2)

That's clearly not the case, however. Someone has been repeatedly using a page I wrote for DB additions, connecting hundreds of thousands of times. I'm at about 650K connections, and about the same for queries (I get about a hundred viewers per day, so I'm very surprised by this). According to their math, I shouldn't be at 2 MCn yet, but they're saying 16.

What's going on?
User Post (2002-09-25 00:00:50 by jplummer)
There's nothing ideal about 1connect/25queries if you can do better. At the moment an app of mine is averaging 1connect/127queries, and these are, for the most part, reasonably separate queries (I'm running a relatively busy MySQL-based wiki). A ratio of 1 isn't better than a ratio of 5.

The previous poster is correct, however:

First, make sure you are only using the queries you need (without going overboard trying to trim them down beyond all reasonable maintainability of your code).
Second, be as efficient as you can with each connnection.
User Post (2002-08-12 21:13:28 by csmc)
Of course, if you have the choice between 1 connection and 25 queries or 1 connection and 5 queries, the 5 queries is definitely better, but it will have a smaller ratio. Don't "use up" the remaining 20 queries just to get a higher ratio if they have no legitimate purpose.