Changeset dba7e5a3c25fc0d84d2ba5672f54fa0330030ac1

Show
Ignore:
Timestamp:
10/23/09 19:52:15 (5 years ago)
Author:
Robert Treat <robert@omniti.com>
git-committer:
Robert Treat <robert@omniti.com> 1256327535 +0000
git-parent:

[b4e8f5046a62f30fbd650329c31fee9beddc45e6]

git-author:
Robert Treat <robert@omniti.com> 1256327535 +0000
Message:

hrmm...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sql/sprocs/stratcon.rollup_metric_numeric.sql

    rb4e8f50 rdba7e5a  
    4242        END IF; 
    4343 
    44         SELECT MIN(whence) FROM metric_numeric_rollup_queue WHERE "interval" = in_roll
     44        SELECT MIN(whence) FROM metric_numeric_rollup_queue WHERE "interval" = in_roll INTO v_min_whence
    4545        EXIT WHEN NOT FOUND; 
    4646 
     
    4848        EXECUTE v_sql INTO v_max_rollup; 
    4949 
     50RAISE NOTICE 'v_min_whence was (%), v_max_rollup was (%)',v_min_whence, v_max_rollup;   
    5051        IF v_min_whence <= v_max_rollup THEN 
    5152            v_sql := 'DELETE FROM metric_numeric_rollup_'||in_roll||' WHERE rollup_time = '||quote_literal(v_min_whence); 
     
    5960            v_temprec.use_whence := 'epoch'::timestamptz + '1 second'::INTERVAL * v_temprec.seconds * floor(extract( epoch FROM now() ) / v_temprec.seconds); 
    6061 
     62RAISE NOTICE '(%,%)',v_temprec.rollup, v_temprec.use_whence;  
    6163            -- Poor mans UPSERT :) 
    6264            INSERT INTO metric_numeric_rollup_queue ("interval", whence) 
    6365                SELECT v_temprec.rollup, v_temprec.use_whence 
    6466                WHERE NOT EXISTS ( 
    65                     SELECT * FROM metric_numeric_rollup_queue WHERE ( "INTERVAL", whence ) = ( v_temprec.rollup, v_temprec.use_whence ) 
     67                    SELECT * FROM metric_numeric_rollup_queue WHERE ( "interval", whence ) = ( v_temprec.rollup, v_temprec.use_whence ) 
    6668                ); 
    6769        END LOOP; 
     
    7072                  FROM  stratcon.unroll_metric_numeric( $2, $1, $3) 
    7173                  GROUP BY sid, name'; 
    72  
     74RAISE NOTICE 'v_sql was (%)',v_sql;  
    7375        FOR v_rec IN EXECUTE v_sql USING v_min_whence - v_conf.seconds * '1 second'::INTERVAL, v_min_whence, v_conf.dependent_on LOOP 
    7476            v_stored_rollup := floor( extract('epoch' from v_rec.rollup_time) / v_conf.span ) + v_conf.window; 
     
    111113 
    112114        -- Delete from whence log table 
    113  
    114         DELETE FROM metric_numeric_rollup_queue WHERE WHENCE=v_min_whence AND INTERVAL=in_roll; 
     115        DELETE FROM metric_numeric_rollup_queue WHERE whence=v_min_whence AND "interval"=in_roll; 
    115116 
    116117        v_min_whence := NULL;