Commit 8f7202e1 authored by Anthony Sotolongo's avatar Anthony Sotolongo
Browse files

modify tables's name for prefix tab_

parent 53fcd9a5
......@@ -5,4 +5,4 @@ round(max_time::numeric,2)as max_time,
round(mean_time::numeric,2) as mean_time,
round(stddev_time::numeric,2) as stddev_time,
query::character varying(40)
from pg_stat_statements where query like '%insert into square_%' order by 7 ;
from pg_stat_statements where query like '%insert into tab_%' order by 7 ;
......@@ -2,14 +2,14 @@ CREATE OR REPLACE FUNCTION trigger_test() RETURNS trigger
AS 'MODULE_PATHNAME','trigger_test'
LANGUAGE C STRICT;
CREATE TABLE square_trgc (i int , area float8, ts timestamp without time zone );
CREATE TABLE tab_trg_c (i int , area float8, ts timestamp without time zone );
CREATE TRIGGER trg_areac
BEFORE INSERT OR UPDATE ON square_trgc
BEFORE INSERT OR UPDATE ON tab_trg_c
FOR EACH ROW EXECUTE PROCEDURE public.trigger_test();
CREATE TABLE square_trgplpgsql (i int , area float8, ts timestamp without time zone );
CREATE TABLE tab_trg_plpgsql (i int , area float8, ts timestamp without time zone );
CREATE OR REPLACE FUNCTION trg_function_area ()
RETURNS TRIGGER
......@@ -28,7 +28,7 @@ LANGUAGE plpgsql ;
CREATE TRIGGER trg_areaplpgsql
BEFORE INSERT OR UPDATE ON square_trgplpgsql
BEFORE INSERT OR UPDATE ON tab_trg_plpgsql
FOR EACH ROW EXECUTE PROCEDURE public.trg_function_area();
......@@ -37,14 +37,14 @@ CREATE OR REPLACE FUNCTION trigger_test_immutable() RETURNS trigger
AS 'MODULE_PATHNAME','trigger_test'
LANGUAGE C STRICT IMMUTABLE;
CREATE TABLE square_trgc_immutable (i int , area float8, ts timestamp without time zone );
CREATE TABLE tab_trg_c_im (i int , area float8, ts timestamp without time zone );
CREATE TRIGGER trg_areac_immutable
BEFORE INSERT OR UPDATE ON square_trgc_immutable
BEFORE INSERT OR UPDATE ON tab_trg_c_im
FOR EACH ROW EXECUTE PROCEDURE public.trigger_test_immutable();
---immutable
CREATE TABLE square_trgplpgsql_immutable (i int , area float8, ts timestamp without time zone );
CREATE TABLE tab_trg_plpgsql_im (i int , area float8, ts timestamp without time zone );
CREATE OR REPLACE FUNCTION trg_function_area_immutable ()
RETURNS TRIGGER
......@@ -63,25 +63,21 @@ LANGUAGE plpgsql IMMUTABLE ;
CREATE TRIGGER trg_areaplpgsql_immutable
BEFORE INSERT OR UPDATE ON square_trgplpgsql_immutable
BEFORE INSERT OR UPDATE ON tab_trg_plpgsql_im
FOR EACH ROW EXECUTE PROCEDURE public.trg_function_area_immutable();
CREATE TABLE square_gc (i int , area float8 GENERATED ALWAYS AS (i^2 ) STORED, ts timestamp without time zone );
CREATE TABLE tab_gc (i int , area float8 GENERATED ALWAYS AS (i^2 ) STORED, ts timestamp without time zone );
ALTER TABLE tab_trg_c SET (autovacuum_enabled = false);
ALTER TABLE tab_trg_plpgsql SET (autovacuum_enabled = false);
ALTER TABLE tab_trg_c_im SET (autovacuum_enabled = false);
ALTER TABLE tab_trg_plpgsql_im SET (autovacuum_enabled = false);
ALTER TABLE tab_gc SET (autovacuum_enabled = false);
ALTER TABLE square_trgc SET (autovacuum_enabled = false);
ALTER TABLE square_trgplpgsql SET (autovacuum_enabled = false);
ALTER TABLE square_trgc_immutable SET (autovacuum_enabled = false);
ALTER TABLE square_trgplpgsql_immutable SET (autovacuum_enabled = false);
ALTER TABLE square_gc SET (autovacuum_enabled = false);
--create index idx_square_trgc on square_trgc (i);
--create index idx_square_trgplpgsql on square_trgplpgsql (i);
--create index idx_square_trgc_immutable on square_trgc_immutable (i);
--create index idx_square_trgplpgsql_immutable on square_trgplpgsql_immutable (i);
--create index idx_square_gc on square_gc (i);
select pg_stat_statements_reset();
......
......@@ -5,4 +5,4 @@ round(max_time::numeric,2)as max_time,
round(mean_time::numeric,2) as mean_time,
round(stddev_time::numeric,2) as stddev_time,
query::character varying(40)
from pg_stat_statements where query like '%update square_%' order by 7 ;
from pg_stat_statements where query like '%update tab_%' order by 7 ;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment