Quantcast
Channel: TimescaleDB and PostgreSQL - Timescale Community Forum
Viewing all articles
Browse latest Browse all 291

Stop inserting value to timescaledb after 1.5 Millions of rows

$
0
0

Hi all,
I implemented a simple architecture based where a sensor send continuous values to the Timescaledb:

Windows Server 2022 Standard (virtual server)
Intel(R) Core™ i5-5250U CPU @ 1.60GHz (2 processors)
RAM 8Gbyte

Postgresql postgresql-16.4-1
Timescaledb timescaledb-2.16.1
ODBC driver psqlodbc-13-01

one single ODBC client (external virtual server) connects the Postgresql hypertable table_real_time structured as below.

And cyclically the sensor via ODBC send data to the hypertable almost 3000 datapoints every 10 seconds.

After some time, when you reach (almost) 1.5 million rows, Insert stops working.
I specify that I have not made any changes to the configurations yet (exception for shared_buffers = 2GB) and it may be necessary to do so, but here I’m asking where I have to start, some suggestions are welcome!

postgres=# \di
                                List of relations
 Schema |               Name               | Type  |  Owner   |       Table
--------+----------------------------------+-------+----------+-------------------
 public | table_real_time__timestamp_idx   | index | postgres | table_real_time
 public | ix_name_time                     | index | postgres | table_real_time
 
postgres=# \diS+
                                                                         List of relations
   Schema   |                      Name                      | Type  |  Owner   |          Table           | Persistence | Access method |    Size    | Description
------------+------------------------------------------------+-------+----------+--------------------------+-------------+---------------+------------+-------------
 public     | table_real_time__timestamp_idx                 | index | postgres | table_real_time          | permanent   | btree         | 8192 bytes |
 public     | ix_name_time                                   | index | postgres | table_real_time          | permanent   | btree         | 8192 bytes |
CREATE TABLE IF NOT EXISTS public.table_real_time
(
    _name text COLLATE pg_catalog."default" NOT NULL,
    _numericid integer,
    _value double precision,
    _timestamp timestamp with time zone NOT NULL,
    _quality integer
)

TABLESPACE pg_default;

ALTER TABLE IF EXISTS public.table_real_time
    OWNER to postgres;


CREATE INDEX IF NOT EXISTS table_real_time__timestamp_idx
    ON public.table_real_time USING btree
    (_timestamp DESC NULLS FIRST)
    TABLESPACE pg_default;


CREATE INDEX IF NOT EXISTS ix_name_time
    ON public.table_real_time USING btree
    (_name COLLATE pg_catalog."default" ASC NULLS LAST, _timestamp DESC NULLS FIRST)
    TABLESPACE pg_default;


CREATE OR REPLACE TRIGGER ts_cagg_invalidation_trigger
    AFTER INSERT OR DELETE OR UPDATE 
    ON public.table_real_time
    FOR EACH ROW
    EXECUTE FUNCTION _timescaledb_functions.continuous_agg_invalidation_trigger('2');


CREATE OR REPLACE TRIGGER ts_insert_blocker
    BEFORE INSERT
    ON public.table_real_time
    FOR EACH ROW
    EXECUTE FUNCTION _timescaledb_functions.insert_blocker();

Best Regards
Alberto_p

5 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 291

Trending Articles