Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable sql query cache in debug mode #13268

Closed

Conversation

andrepereiradasilva
Copy link
Contributor

@andrepereiradasilva andrepereiradasilva commented Dec 18, 2016

Pull Request for Issue #13265.

Summary of Changes

This PR makes the query cache disabled when db driver runs in debug mode.
Only for mysql, because the profiling only seems to work there.

Also add checks for profiling in pdomysql (was missing), which meand pdo mysql driver now as the "Profile" in debug console too.

Testing Instructions

  1. Apply patch
  2. Enable debug mode in global config and system debug plugin
  3. Test Mysql, MySqli and PDO Mysql drivers: Reload the pages and confirm in debug console "Database Queries" "Profile" that each query in run without using db cache

Example

With query cache
image

Without query cache
image

Documentation Changes Required

None.

Notes

@csthomas
Copy link
Contributor

There is also option DEMAND which may add some flexibility.
http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_query_cache_type
https://mariadb.com/kb/en/mariadb/server-system-variables/#query_cache_type

I do not know if anybody care but for mysql driver missing line:
mysql_query($this->connection, 'SET profiling_history_size = 100;');

@andrepereiradasilva
Copy link
Contributor Author

andrepereiradasilva commented Dec 19, 2016

Yeah i noticed that too. Didn't add it because i have no MySQL drivers to test. If anyone confirms it works i can add it.

@csthomas
Copy link
Contributor

IMHO It does not depend on type of driver like mysql or mysqli or pdomysql.
http://stackoverflow.com/questions/8443674/profiling-and-optimising-php-mysql-websites

@andrepereiradasilva
Copy link
Contributor Author

ok added to mysql too, but his needs to be tested in mysql also

@csthomas
Copy link
Contributor

I have tested this item ✅ successfully on eecd48e

Code review + I have tested it before and after patch on mysql, mysqli and pdomysql with successful.
On debug mode is now with out checking query cache.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13268.

@waader
Copy link
Contributor

waader commented Mar 28, 2017

Profil comes with this message: "No SHOW PROFILE (maybe because there are more than 100 queries)"
But I have only 26 queries logged. The system plugin is enabled with each option set to yes.

Does somebody know what´s going on here?

@brianteeman brianteeman added the Ready to take over This is an abandoned feature which can be taken over by another person to finish it. label Sep 9, 2017
@brianteeman
Copy link
Contributor

The query cache is deprecated as of MySQL 5.7.20, and is removed in MySQL 8.0.

as of MySQL 5.6.8 query cache is now disabled by default
source https://dev.mysql.com/doc/refman/5.7/en/query-cache-configuration.html

@csthomas
Copy link
Contributor

csthomas commented Jan 4, 2018

@brianteeman Is there any rule? How to become a new owner?

@mbabker
Copy link
Contributor

mbabker commented Jan 4, 2018

Fork the source branch of the PR, make your changes, and open a new PR.

@brianteeman
Copy link
Contributor

@csthomas will you be able to take over this?

@csthomas
Copy link
Contributor

csthomas commented May 9, 2018

I created a new PR #20322.

@joomla-cms-bot
Copy link

Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/13268

@joomla-cms-bot joomla-cms-bot removed the Ready to take over This is an abandoned feature which can be taken over by another person to finish it. label May 9, 2018
@ghost
Copy link

ghost commented May 9, 2018

closed in favor of PR #20322 as stated above.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13268.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants