Changeset a2c8a40a569ad8bc6677c21303849d5844ce5436

Show
Ignore:
Timestamp:
05/21/08 20:25:37 (6 years ago)
Author:
Denish Patel <denish@omniti.com>
git-committer:
Denish Patel <denish@omniti.com> 1211401537 +0000
git-parent:

[32f6f1637a8a074aa51f1c3e0a79963d67afdb79]

git-author:
Denish Patel <denish@omniti.com> 1211401537 +0000
Message:

Updated roll ups functions to process all available records from log_whence_s table by interval.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sql/schema.sql

    rb927b3b ra2c8a40  
    332332 v_nrunning INT; 
    333333 v_self VARCHAR(22); 
    334   
     334 whenceint RECORD; 
    335335BEGIN 
    336336 
     
    356356 
    357357  EXECUTE v_sql; 
     358 
     359FOR whenceint IN SELECT * FROM stratcon.log_whence_s WHERE interval='5 minutes' LOOP 
     360         
    358361 
    359362 SELECT MIN(whence) FROM stratcon.log_whence_s WHERE interval='5 minutes' 
     
    397400   
    398401  DELETE FROM stratcon.log_whence_s WHERE WHENCE=v_min_whence AND INTERVAL='5 minutes'; 
     402  
     403 v_min_whence:= NULL; 
     404 v_max_rollup_5:= NULL; 
     405  
     406 END LOOP; 
    399407  
    400408  UPDATE stratcon.rollup_runner SET RUNNER = '' WHERE ROLLUP_TABLE= 'rollup_matrix_numeric_5m'; 
     
    428436 v_nrunning INT; 
    429437 v_self VARCHAR(22); 
    430  
     438 whenceint RECORD; 
    431439BEGIN 
    432440 
     
    452460 
    453461  EXECUTE v_sql; 
     462 
     463FOR whenceint IN SELECT * FROM stratcon.log_whence_s WHERE interval='20 minutes' LOOP 
    454464 
    455465 SELECT MIN(whence) FROM stratcon.log_whence_s WHERE interval='20 minutes' 
     
    494504   
    495505  DELETE FROM stratcon.log_whence_s WHERE WHENCE=v_min_whence AND INTERVAL='20 minutes'; 
     506  
     507  v_min_whence:= NULL; 
     508  v_max_rollup_20:= NULL; 
     509 
     510 END LOOP; 
    496511  
    497512  UPDATE stratcon.rollup_runner SET RUNNER = '' WHERE ROLLUP_TABLE= 'rollup_matrix_numeric_20m'; 
     
    524539  v_nrunning INT; 
    525540  v_self VARCHAR(22); 
    526  
     541  whenceint RECORD; 
    527542BEGIN 
    528543 
     
    549564  EXECUTE v_sql; 
    550565 
     566FOR whenceint IN SELECT * FROM stratcon.log_whence_s WHERE interval='1 hour' LOOP 
     567            
    551568  SELECT min(whence) FROM stratcon.log_whence_s WHERE interval='1 hour' 
    552569         INTO v_min_whence; 
     
    588605DELETE FROM stratcon.log_whence_s WHERE WHENCE=v_min_whence AND INTERVAL='1 hour'; 
    589606 
     607v_min_whence := NULL; 
     608v_max_rollup_60 := NULL; 
     609 
     610END LOOP; 
     611 
    590612UPDATE stratcon.rollup_runner SET RUNNER = '' WHERE ROLLUP_TABLE= 'rollup_matrix_numeric_60m'; 
    591613 
     
    616638  v_nrunning INT; 
    617639  v_self VARCHAR(22); 
    618      
     640  whenceint RECORD;   
    619641BEGIN 
    620642 
     
    640662 
    641663  EXECUTE v_sql; 
     664 
     665FOR whenceint IN SELECT * FROM stratcon.log_whence_s WHERE interval='6 hours' LOOP 
    642666 
    643667  SELECT min(whence) FROM stratcon.log_whence_s WHERE interval='6 hours' 
     
    680704 
    681705DELETE FROM stratcon.log_whence_s WHERE WHENCE=v_min_whence AND INTERVAL='6 hours'; 
     706v_min_whence := NULL; 
     707v_max_rollup_6 := NULL; 
     708 
     709END LOOP; 
    682710 
    683711UPDATE stratcon.rollup_runner SET RUNNER = '' WHERE ROLLUP_TABLE= 'rollup_matrix_numeric_6hours'; 
     
    709737  v_nrunning INT; 
    710738  v_self VARCHAR(22); 
    711   
     739  whenceint RECORD;  
    712740  
    713741BEGIN 
     
    735763  EXECUTE v_sql; 
    736764 
     765 FOR whenceint IN  SELECT * FROM stratcon.log_whence_s WHERE interval='12 hours' LOOP 
     766  
    737767  SELECT min(whence) FROM stratcon.log_whence_s WHERE interval='12 hours' 
    738768         INTO v_min_whence; 
     
    774804 
    775805DELETE FROM stratcon.log_whence_s WHERE WHENCE=v_min_whence AND INTERVAL='12 hours'; 
     806 
     807v_min_whence := NULL; 
     808v_max_rollup_12 := NULL; 
     809 
     810END LOOP; 
    776811 
    777812UPDATE stratcon.rollup_runner SET RUNNER = '' WHERE ROLLUP_TABLE= 'rollup_matrix_numeric_12hours';