Sorry Alex

mauricecano posted 16th of February 2010 in Community Voice. 6 comments.

I do want to apologize for my ignorance in this post on what was going on with my sql.  I was given erroneous advice from my host and after further research identified the issue.  I want to apologize to boonex and Alex for this post.

Please login to post a comment.
I am not sure if you can do that in all areas of dolphin. But perhaps there is something your not aware of.

SELECT `ID` FROM `Profiles` WHERE `ID` = 10 LIMIT 1

That will return only the ID from the database where ID = 10. If dolphin needs any of the other profile fields other than the ID then that query will not be enough.
I didn't mean to simply every query by just ID, it was an example. The expressions can be rewritten to only columns needed. As an other example, I highly doubt accessdenied.php needs all other 51 default columns of data to find out if the person can view a page. A main issue is that they're calling to the database for every check, there isn't any sort of cache info used so on the home page each block makes its own call to the database, lots of it duplicating queries from other modules.
You understanding of SQL is wrong ! If search field is indexed then MySQL do not examine rows at all, it get it directly, because it is indexed.

"SELECT *" is used in places where most of the fields are user or may be used - also it is not related to the query execution speed.

Also profiles are cached and once cached no access to database is performed to get particular profile info.
Thanks for the reply Alex but we received a report back from our host stating that the program is continuously going back to the database, especially the profile table. Further, the databases are not set to index or cache. We asked if this was our setup and they examined the files and said this is a result from the dolphin programming.
Mauricecano, I wonder if he is saying that if you enable caching for you site (HTML, images, CSS, and JS) this would reduce the SQL queries to the database. Queries would only be done if the information has been changed. So either way, the site would need to "periodically" contact the database to make sure everything matched, but should on every single load.

Not sure if I have that right or not.
If you have problems with Dolphin speed I suggest you to use "Profiler" module to find bottlenecks.
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.