返回首页

gbase数据、南大通用产品文档:GBase8a

更新日期:2024年09月11日

Intelligent Indexing
Intelligent indexing is a type of coarse-grained index that includes data statistics.
When data is stored, every 65536 rows of data are packed into a Data Cell (DC)
package, and an intelligent index is automatically created for each package when the
data is imported. During data querying, statistics values can be obtained and data

GBase 8a MPP Cluster Technical White Paper
- 12 -
General Data Technology Co., Ltd.
filtering can be performed without unpacking the package, which can further reduce
I/O and significantly optimize complex queries. As shown in the figure below, the
"SmartIndex of Col 1" on the left represents the intelligent index built on the first
column data, with each data package (DC) as the unit.
Figure 3-3. Diagram of an intelligent index.
1)indexes without requiring users to manually create and maintain them.
2)Intelligent indexes themselves occupy a small space (about 1%), and do not
cause data inflation.
3)Intelligent indexes are established based on data packets, with fast creation
speed and unaffected by existing data packets.
Compared with traditional database indexing techniques, intelligent indexes are
established
on
data
packets
(coarse-grained
indexing),
and
each
field
is
automatically indexed, while traditional indexes are established on each row of data
(fine-grained indexing). Therefore, accessing intelligent indexes requires less I/O
than accessing traditional indexes. At the same time, the space occupied by
intelligent indexes is about one percent of the data, while traditional database
indexes can occupy 20-50% of the data.

GBase 8a MPP Cluster Technical White Paper
General Data Technology Co., Ltd.
- 13 -

通过使用 C 间隔结构,来为 SQL 间隔数据类型指定 C 数据类型。
下列结构为 SQL 间隔数据类型指定 C 数据类型:
typedef struct tagSQL_INTERVAL_STRUCT
{
SQLINTERVAL interval_type;
SQLSMALLINT interval_sign;
union
{
SQL_YEAR_MONTH_STRUCT year_month;
SQL_DAY_SECOND_STRUCT day_second;
} intval;
}SQLINTERVAL_STRUCT;

typedef enum

GBase 8s ODBC Driver 程序员指南
南大通用数据技术股份有限公司
- 61 -
{
SQL_IS_YEAR=1,
SQL_IS_MONTH=2,
SQL_IS_DAY=3,
SQL_IS_HOUR=4,
SQL_IS_MINUTE=5,
SQL_IS_SECOND=6,
SQL_IS_YEAR_TO_MONTH=7,
SQL_IS_DAY_TO_HOUR=8,
SQL_IS_DAY_TO_MINUTE=9,
SQL_IS_DAY_TO_SECOND=10,
SQL_IS_HOUR_TO_MINUTE=11,
SQL_IS_HOUR_TO_SECOND=12,
SQL_IS_MINUTE_TO_SECOND=13,
}SQLINTERVAL;

typedef struct tagSQL_YEAR_MONTH
{
SQLUINTEGER year;
SQLUINTEGER month;
}SQL_YEAR_MOHTH_STRUCT;

typedef struct tagSQL_DAY_SECOND
{
SQLUINTEGER day;
SQLUNINTEGER hour;
SQLUINTEGER minute;
SQLUINTEGER second

根据贵组织的需求,您可以负责执行以下各段中描述的定期任务。并不是所有这些任务都
适合每个安装。例如,如果您的数据库服务器每天运行 24 小时、每周运行 7 天,那么您
就不可以使数据库服务器进入脱机方式,这样数据库服务器的运行方式将不能定期更改。
更改数据库服务器方式
数据库服务器管理员负责通过更改方式来启动和关闭数据库服务器。数据库服务器运行方
式说明了如何更改数据库服务器方式。
备份数据和逻辑日志文件
要确保能够在发生故障时恢复数据库,请经常备份存储空间和逻辑日志。您也可以使用
archecker 实用程序验证 ON-Bar 备份。
每隔多少时间备份一次存储空间将取决于更新数据的频率以及数据的重要性如何。备份调
度可以包括每周进行一次完全(0 级)备份、每天进行增量(1 级)
备份以及每小时进行 2
级备份。还必须在执行管理任务(如添加数据库空间、删除逻辑日志文件或启用镜像)后
执行 0 级备份。
每个逻辑日志文件一满就立即备份该文件。可以手动或自动备份这些文件。有关使用
ON-Bar 和 ontape 的信息,请参阅《GBase 8s 备份与复原指南》。
监视活动
GBase 8s 数据库服务器的设计使您能够监视数据库服务器的每个方面。监视数据库服务
器活动提供了对于可用信息的描述、有关获取信息的指示信息以及有关使用信息的建议。
检查一致性
对数据的一致性执行不定期的检查。有关这些任务的描述,请参 阅一致性检查。