Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1.
- rsbd1 > select * from master_get_active_worker_nodes();
- node_name | node_port
- -----------+-----------
- (0 rows)
- Wezly robocze nie widza siebie nawzajem, komunikacja jest zarzadzana przez wezel nadzorczy.
- 2.
- SELECT create_distributed_table('measurements', 'me_or_id', colocate_with=>'organizations');
- 3.
- rsbd1=# \d measurements_102082
- Table "public.measurements_102082"
- Column | Type | Collation | Nullable | Default
- ----------------+--------------------------+-----------+----------+---------
- me_id | integer | | not null |
- me_time | timestamp with time zone | | |
- me_temperature | numeric | | |
- me_lo_id | integer | | |
- me_or_id | integer | | not null |
- Indexes:
- "measurements_pkey_102082" PRIMARY KEY, btree (me_or_id, me_id)
- Foreign-key constraints:
- "measurements_me_or_id_fkey1_102082" FOREIGN KEY (me_or_id, me_lo_id) REFERENCES loggers_102050(lo_or_id, lo_id)
- "measurements_me_or_id_fkey_102082" FOREIGN KEY (me_or_id) REFERENCES organizations_102018(or_id)
- Wedlug dokumentacji Citus nie przeprowadza automatycznie balansowania obciazenia, wiec zapewne wierwsze nie zostaly podzielone po rowno.
- 4.
- Distributed Query into pg_merge_job_0003
- Executor: Real-Time
- Task Count: 32
- Tasks Shown: One of 32
- -> Task
- Node: host=localhost port=5432 dbname=postgres
- -> Nested Loop (cost=0.15..31.13 rows=1 width=232)
- -> Seq Scan on measurements_102072 measurements (cost=0.00..22.95 rows=1 width=22)
- Filter: ((me_time >= '2017-03-15 08:13:00'::timestamp without time zone) AND (me_time <= '2017-03-15 09:18:00'::timestamp without time zo
- ne))
- -> Index Scan using loggers_pkey_102040 on loggers_102040 loggers (cost=0.15..8.17 rows=1 width=226)
- Index Cond: ((lo_or_id = measurements.me_or_id) AND (lo_id = measurements.me_lo_id))
- Master Query
- -> Sort (cost=0.00..0.00 rows=0 width=0)
- Sort Key: intermediate_column_3_1
- -> Seq Scan on pg_merge_job_0003 (cost=0.00..0.00 rows=0 width=0)
- (15 rows)
- 32 zadania, gdzie laczny koszt jednego to 62.25
- 5.
- "me_time_idx_102082" btree (me_time)
- 6.
- Index Scan using me_time_idx_102072 on measurements_102072 measurements (cost=0.28..8.29 rows=1 width=22)
- Koszt spadl z 62.25 do 32.93
- 7.
- Distributed Query
- Executor: Router
- Task Count: 1
- Tasks Shown: All
- -> Task
- Node: host=localhost port=5432 dbname=postgres
- -> Nested Loop (cost=0.43..16.48 rows=1 width=232)
- -> Index Scan using me_time_idx_102082 on measurements_102082 measurements (cost=0.29..8.31 rows=1 width=22)
- Index Cond: ((me_time >= '2017-03-15 08:13:00'::timestamp without time zone) AND (me_time <= '2017-03-15 09:18:00'::timestamp without time zone))
- 8.
- rsbd1=# SELECT * from logger_types_102104;
- lt_id | lt_name
- -------+--------------
- 4 | LoggerType4
- 2 | LoggerType2
- 1 | LoggerType1
- 0 | LoggerType0
- -1 | LoggerType-1
- -2 | LoggerType-2
- 6 | LoggerType6
- (7 rows)
- 9.
- rsbd1=# SELECT * from logger_types_102104;
- lt_id | lt_name
- -------+------------------
- 4 | LoggerType4
- 1 | LoggerType1
- 0 | LoggerType0
- -1 | LoggerType-1
- -2 | LoggerType-2
- 6 | LoggerType6
- 2 | TypRejestratora2
- (7 rows)
- 10.
- Jedna baza danych
- Distributed Query
- Executor: Router
- Task Count: 1
- Tasks Shown: All
- -> Task
- Node: host=localhost port=5432 dbname=postgres
- -> Nested Loop (cost=0.58..24.66 rows=1 width=290)
- -> Nested Loop (cost=0.43..16.48 rows=1 width=236)
- -> Index Scan using me_time_idx_102082 on measurements_102082 measurements (cost=0.29..8.31 rows=1 width=22)
- Index Cond: ((me_time >= '2017-03-15 08:13:00'::timestamp without time zone) AND (me_time <= '2017-03-15 09:18:00'::timestamp witho
- ut time zone))
- 11.
- mkdir -p /var/lib/pgsql/rsbd3
- initdb /var/lib/pgsql/rsbd3
- vim /var/lib/pgsql/rsbd3/postgres.conf
- pg_ctl -D rsbd3 -l logfile_rsbd3 start
- 12.
- rsbd3=# \dt
- List of relations
- Schema | Name | Type | Owner
- --------+---------------------+-------+----------
- public | logger_types_102104 | table | postgres
- (1 row)
- 124,1 Bot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement