Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.63 KB | None | 0 0
  1. 1.
  2. rsbd1 > select * from master_get_active_worker_nodes();
  3. node_name | node_port
  4. -----------+-----------
  5. (0 rows)
  6.  
  7. Wezly robocze nie widza siebie nawzajem, komunikacja jest zarzadzana przez wezel nadzorczy.
  8.  
  9. 2.
  10. SELECT create_distributed_table('measurements', 'me_or_id', colocate_with=>'organizations');
  11.  
  12. 3.
  13. rsbd1=# \d measurements_102082
  14. Table "public.measurements_102082"
  15. Column | Type | Collation | Nullable | Default
  16. ----------------+--------------------------+-----------+----------+---------
  17. me_id | integer | | not null |
  18. me_time | timestamp with time zone | | |
  19. me_temperature | numeric | | |
  20. me_lo_id | integer | | |
  21. me_or_id | integer | | not null |
  22. Indexes:
  23. "measurements_pkey_102082" PRIMARY KEY, btree (me_or_id, me_id)
  24. Foreign-key constraints:
  25. "measurements_me_or_id_fkey1_102082" FOREIGN KEY (me_or_id, me_lo_id) REFERENCES loggers_102050(lo_or_id, lo_id)
  26. "measurements_me_or_id_fkey_102082" FOREIGN KEY (me_or_id) REFERENCES organizations_102018(or_id)
  27.  
  28. Wedlug dokumentacji Citus nie przeprowadza automatycznie balansowania obciazenia, wiec zapewne wierwsze nie zostaly podzielone po rowno.
  29. 4.
  30. Distributed Query into pg_merge_job_0003
  31. Executor: Real-Time
  32. Task Count: 32
  33. Tasks Shown: One of 32
  34. -> Task
  35. Node: host=localhost port=5432 dbname=postgres
  36. -> Nested Loop (cost=0.15..31.13 rows=1 width=232)
  37. -> Seq Scan on measurements_102072 measurements (cost=0.00..22.95 rows=1 width=22)
  38. 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
  39. ne))
  40. -> Index Scan using loggers_pkey_102040 on loggers_102040 loggers (cost=0.15..8.17 rows=1 width=226)
  41. Index Cond: ((lo_or_id = measurements.me_or_id) AND (lo_id = measurements.me_lo_id))
  42. Master Query
  43. -> Sort (cost=0.00..0.00 rows=0 width=0)
  44. Sort Key: intermediate_column_3_1
  45. -> Seq Scan on pg_merge_job_0003 (cost=0.00..0.00 rows=0 width=0)
  46. (15 rows)
  47.  
  48.  
  49. 32 zadania, gdzie laczny koszt jednego to 62.25
  50.  
  51. 5.
  52. "me_time_idx_102082" btree (me_time)
  53.  
  54. 6.
  55. Index Scan using me_time_idx_102072 on measurements_102072 measurements (cost=0.28..8.29 rows=1 width=22)
  56. Koszt spadl z 62.25 do 32.93
  57.  
  58. 7.
  59. Distributed Query
  60. Executor: Router
  61. Task Count: 1
  62. Tasks Shown: All
  63. -> Task
  64. Node: host=localhost port=5432 dbname=postgres
  65. -> Nested Loop (cost=0.43..16.48 rows=1 width=232)
  66. -> Index Scan using me_time_idx_102082 on measurements_102082 measurements (cost=0.29..8.31 rows=1 width=22)
  67. 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))
  68.  
  69. 8.
  70. rsbd1=# SELECT * from logger_types_102104;
  71. lt_id | lt_name
  72. -------+--------------
  73. 4 | LoggerType4
  74. 2 | LoggerType2
  75. 1 | LoggerType1
  76. 0 | LoggerType0
  77. -1 | LoggerType-1
  78. -2 | LoggerType-2
  79. 6 | LoggerType6
  80. (7 rows)
  81.  
  82. 9.
  83. rsbd1=# SELECT * from logger_types_102104;
  84. lt_id | lt_name
  85. -------+------------------
  86. 4 | LoggerType4
  87. 1 | LoggerType1
  88. 0 | LoggerType0
  89. -1 | LoggerType-1
  90. -2 | LoggerType-2
  91. 6 | LoggerType6
  92. 2 | TypRejestratora2
  93. (7 rows)
  94.  
  95. 10.
  96. Jedna baza danych
  97.  
  98. Distributed Query
  99. Executor: Router
  100. Task Count: 1
  101. Tasks Shown: All
  102. -> Task
  103. Node: host=localhost port=5432 dbname=postgres
  104. -> Nested Loop (cost=0.58..24.66 rows=1 width=290)
  105. -> Nested Loop (cost=0.43..16.48 rows=1 width=236)
  106. -> Index Scan using me_time_idx_102082 on measurements_102082 measurements (cost=0.29..8.31 rows=1 width=22)
  107. 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
  108. ut time zone))
  109. 11.
  110. mkdir -p /var/lib/pgsql/rsbd3
  111. initdb /var/lib/pgsql/rsbd3
  112. vim /var/lib/pgsql/rsbd3/postgres.conf
  113. pg_ctl -D rsbd3 -l logfile_rsbd3 start
  114.  
  115.  
  116. 12.
  117. rsbd3=# \dt
  118. List of relations
  119. Schema | Name | Type | Owner
  120. --------+---------------------+-------+----------
  121. public | logger_types_102104 | table | postgres
  122. (1 row)
  123.  
  124.  
  125. 124,1 Bot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement