Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Revert "Don't try to EXPLAIN select_db calls" | Xavier Noria | 2013-05-11 | 1 | -1/+1 |
| | | | | | | Reason: This was backported, but the test does not pass as is. This reverts commit a33d320cf4b57fabd9c299b09c217ee3955ecc77. | ||||
* | Don't try to EXPLAIN select_db calls | Daniel Schierbeck | 2013-05-10 | 1 | -1/+1 |
| | |||||
* | Backport explain fixes. | Rafael Mendonça França | 2012-09-16 | 1 | -1/+2 |
| | | | | | | | | * Mark as SCHEMA some schema database queries. #7648 * Don't explain queries except normal CRUD sql. #7657 Closes #6458 Closes #7544 | ||||
* | let automatic EXPLAIN ignore CACHE notifications | Xavier Noria | 2012-02-03 | 1 | -1/+4 |
| | |||||
* | moves some auto explain logic to the subscriber [José Valim & Xavier Noria] | Xavier Noria | 2011-12-04 | 1 | -2/+12 |
| | |||||
* | simplifies ActiveRecord::ExplainSubscriber [José Valim & Xavier Noria] | Xavier Noria | 2011-12-04 | 1 | -8/+6 |
| | |||||
* | implements a much faster auto EXPLAIN, closes #3843 [José Valim & Xavier Noria] | Xavier Noria | 2011-12-04 | 1 | -0/+13 |
This commit vastly reduces the impact of auto explain logging when enabled, while keeping a negligible cost when disabled. The first implementation was based on the idea of subscribing to "sql.active_record" when needed, and unsubscribing once done. This is the idea behind AR::Relation#explain. Subscribe, collect, unsubscribe. But with the current implementation of notifications unsubscribing is costly, because it wipes an internal cache and that puts a penalty on the next event. So we are switching to an approach where a long-running subscriber is listening. Instead of collecting the queries with a closure in a dedicated subscriber, now we setup a thread local. If the feature is disabled by setting the threshold to nil, the subscriber will call a method that does nothing. That's totally cheap. |