On Sat, Mar 5, 2011 at 7:34 PM, marcin mank wrote:
> Is this fast enough on a slave:
>
>
> with deltas as (select * from get_delta_table(...)),
> p95 as(select round(count(volume_id) * 0.95) as p95v from deltas)
> select
> (select in_rate from deltas, p95 where
> in_rate_order = p95v),
> (select o
On Fri, Mar 4, 2011 at 4:18 PM, Landreville
wrote:
> create temporary table deltas on commit drop as
> select * from get_delta_table(p_switchport_id, p_start_date,
> p_end_date);
>
> select round(count(volume_id) * 0.95) into v_95th_row from deltas;
> select in_rate into v_record.
Any time the volume tables are queried it is to calculate the deltas
between each in_octets and out_octets from the previous row (ordered
by timestamp). The delta is used because the external system, where
the data is retrieved from, will roll over the value sometimes. I
have a function to do t
This is not a performance bug -- my query takes a reasonably long
amount of time, but I would like to see if I can get this calculation
any faster in my setup.
I have a table:
volume_id serial primary key
switchport_id integer not null
in_octets bigint not null
out_octets bigint not null
insert_ti