在Postgresql中,索引类型大致有以下几种:
B-tree,Hash,Gist,SP-Gist,Gin,BRin
Postgresql默认使用B-Tree创建索引,创建索引的语法如下:
create index idx_name on tb_nam…
//最优的分块方式为sqrt(n)
int block sqrt(n) //分块 块的大小为block
int t n/block // 分出多少块 数量为t
if (n % block) t ; //分块后可能还会有多余的,需要再额外加一个小块
for (int i 1 ; i < t ; i )
{st[i] (i - 1)*block 1;//每个块的起点ed[i]…