I do not quite agree with just solving #2175 by saying 'we' should just increase the slow query limit.
Although there are a lot of factors for a slow insert, we as developers should always check if there is something wrong and if we can optimise something. The query showed in the slow log is, for me, not looking efficient (enough).
I think the query would be more optimal by writing it like this.
Also changing the primary key to "local_data_id, rrd_name, time", (which not only will be more logic regarding the table lay-out) we would result in having a more efficient index (with the same effect). Only thing is that I have not the correct tools for changing this at this moment. If you could change this PK, the select statement of this insert would have two key elements it could use instead of one (because the select does not have 'time' in it).
The more optimal query:
INSERT INTO data_source_stats_hourly (local_data_id, rrd_name, average, peak)
(SELECT local_data_id, rrd_name, AVG(`value`), MAX(`value`)
FROM data_source_stats_hourly_cache
WHERE `value` IS NOT NULL
GROUP BY local_data_id, rrd_name)
ON DUPLICATE KEY UPDATE average=VALUES(average), peak=VALUES(peak);
- DSStats Avg/Peak function broken due to change in RRDtool processing
- Additionally move to set_config_option() function to remove inline SQL
- Convert echo to print per spec
- Debated moving DSStats RRDtool functions to core, but will do in a
project
Good catch on the bug fixes too. Hard to spot.
_______________________________________________________
* Updated Dutch translations
- Fixed i18n
* Defined fields in queries
* Fixed changelog
* Updated Dutch translations
* Various fixes
All committed files:
- true|false to lowercase
add_perms.php:
- displayGroups() was undefined
add_tree.php:
- duplicate case for '--quiet'
repair_templates.php:
- correction function call to diaplay_version()
gettext.php:
- PHP EOF unneeded
* Updated Dutch translations
- Updated Dutch translations with latest cacti.pot file
* Updated Dutch translations
- Fixed conflicts in translations
2) Allow Locking/UnLocking of Graphs
3) ToolTips
4) Correct Minor Issues with Login/Out/Permission associated with Theme JS
5) Upgrade jQuery which has Fixes for Major issue in Safari 7/8.1
git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/cacti/branches/0.8.8@7662 860744bd-22fc-0310-8c96-e9fe5004b5ca
Change double quotes to single quotes where possible
Move to prepared statements were possible
Fix line endings on a few files
git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/cacti/branches/0.8.8@7609 860744bd-22fc-0310-8c96-e9fe5004b5ca
- Enhancement of breadcrumbs to include Tree information in Ajax response.
- Removing all double quotes from 'include' files for performance.
- Some cleanups in cdef.php
- Enhancement of 'Send Test Email' to use Dialog jQuery plugin
- Fixed (finally) the last remaining issues with re-sizable columns
- Some CSS cleanup
- Fix main tabs not highlighting
- Add consistent help screens to CLI and pollers relative to versions and copyright years (now a constant)
git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/cacti/branches/0.8.8@7551 860744bd-22fc-0310-8c96-e9fe5004b5ca