您的当前位置:首页sysbench压测openGauss
sysbench压测openGauss
来源:锐游网
sysbench
sysbench oltp_common --db-driver=pgsql --time=60 --threads=25 --report-interval=1 --pgsql-host=172.30x.x --pgsql-port=44085 --pgsql-user=bpx --pgsql-password=xxxx --pgsql-db=bpx --tables=250 --table-size=10000 prepare
SET search_path TO my_schema;
在openGauss数据库中,可以使用以下命令切换schema:
SET search_path TO schema_name;
其中,schema_name
是要切换到的目标schema的名称。这个命令将当前会话的搜索路径设置为指定的schema,使得在没有指定schema名称的情况下执行查询时,会自动在该schema下查找相应的表和对象。
例如,要切换到名为"my_schema"的schema,可以执行以下命令:
SET search_path TO my_schema;
之后,在执行查询或操作时,如果没有显式指定schema名称,系统将默认在"my_schema"下进行查找和操作。
\d[S+] list tables, views, and sequences
\d[S+] NAME describe table, view, sequence, or index
表、序列
bpx=# \d+ sbtest1
Table "bpx.sbtest1"
Column | Type | Modifiers | Storage | Stats target | Description
--------+----------------+------------------------------------------------------+----------+--------------+-------------
id | integer | not null default nextval('sbtest1_id_seq'::regclass) | plain | |
k | integer | not null default 0 | plain | |
c | character(120) | not null default ''::bpchar | extended | |
pad | character(60) | not null default ''::bpchar | extended | |
Indexes:
"sbtest1_pkey" PRIMARY KEY, btree (id) TABLESPACE pg_default
"k_1" btree (k) TABLESPACE pg_default
Has OIDs: no
Options: orientation=row, compression=no
bpx=# \d+ sbtest100_id_seq
Sequence "bpx.sbtest100_id_seq"
Column | Type | Value | Storage
---------------+---------+---------------------+---------
sequence_name | name | sbtest100_id_seq | plain
last_value | bigint | 10000 | plain
start_value | bigint | 1 | plain
increment_by | bigint | 1 | plain
max_value | bigint | 9223372036854775807 | plain
min_value | bigint | 1 | plain
cache_value | bigint | 1 | plain
log_cnt | bigint | 32 | plain
is_cycled | boolean | f | plain
is_called | boolean | t | plain
uuid | bigint | 0 | plain
Owned by: bpx.sbtest100.id
nextval('sbtest1_id_seq'::regclass)
是一个 PostgreSQL 数据库中的函数。它用于获取指定序列(sequence)的下一个值。
在这个例子中,'sbtest1_id_seq'::regclass
是将字符串 'sbtest1_id_seq'
转换为 regclass
类型。regclass
是 PostgreSQL 中的特殊类型,用于表示表或序列的名称。
函数 nextval()
返回指定序列的下一个值。它从序列中获取一个新的值,并且将该序列的计数器加一。
因此,nextval('sbtest1_id_seq'::regclass)
的作用是返回名为 'sbtest1_id_seq'
的序列的下一个值。
bpx=# select nextval('sbtest1_id_seq'::regclass);
nextval
---------
10001
(1 row)
因篇幅问题不能全部显示,请点此查看更多更全内容