Index: frontends/php/include/classes/class.cchart.php =================================================================== --- frontends/php/include/classes/class.cchart.php (revision 12359) +++ frontends/php/include/classes/class.cchart.php (working copy) @@ -237,7 +237,12 @@ $calc_field = 'round('.$x.'*(mod('.zbx_dbcast_2bigint('clock').'+'.$z.','.$p.'))/('.$p.'),0)'; /* required for 'group by' support of Oracle */ $sql_arr = array(); + +// [ZBX-3249] for partitioned DB installs! + if(ZBX_HISTORY_DATA_UPKEEP > -1) $real_item['history'] = ZBX_HISTORY_DATA_UPKEEP; +//--- + if((($real_item['history']*86400) > (time()-($this->from_time+$this->period/2))) && // should pick data from history or trends (($this->period / $this->sizeX) <= (ZBX_MAX_TREND_DIFF / ZBX_GRAPH_MAX_SKIP_CELL))) // is reasonable to take data from history? { Index: frontends/php/include/classes/class.cpie.php =================================================================== --- frontends/php/include/classes/class.cpie.php (revision 12359) +++ frontends/php/include/classes/class.cpie.php (working copy) @@ -180,6 +180,10 @@ $sql_arr = array(); +// [ZBX-3249] for partitioned DB installs! + if(ZBX_HISTORY_DATA_UPKEEP > -1) $real_item['history'] = ZBX_HISTORY_DATA_UPKEEP; +//--- + if((($real_item['history']*86400) > (time()-($from_time+$this->period/2))) && // should pick data from history or trends (($this->period / $this->sizeX) <= (ZBX_MAX_TREND_DIFF / ZBX_GRAPH_MAX_SKIP_CELL))) // is reasonable to take data from history? { Index: frontends/php/include/defines.inc.php =================================================================== --- frontends/php/include/defines.inc.php (revision 12359) +++ frontends/php/include/defines.inc.php (working copy) @@ -52,6 +52,10 @@ define('ZBX_SCRIPT_TIMEOUT', 360); // in seconds define('ZBX_SCRIPT_BYTES_LIMIT', 1073741824); // 1073741824 is 1MB in bytes + +// this define made for partitioned DB installs!! + define('ZBX_HISTORY_DATA_UPKEEP', -1); // in days; -1: disabled, 0: always use trends + /* END OF USERS DEFINES */ define('ZBX_FONT_NAME', 'DejaVuSans');