摘要:
一、in关键字 确定给定的值是否与子查询或列表中的值相匹配。in在查询的时候,首先查询子查询的表,然后将内表和外表做一个笛卡尔积,然后按照条件进行筛选。所以相对内表比较小的时候,in的速度较快。 select * from A where id in (select id from B) #等价于 阅读全文
摘要:
-- 创建表 DROP TABLE IF EXISTS tba; CREATE TABLE tba ( id serial , peaktemp int, js jsonb, logdate date not null ) PARTITION BY RANGE (logdate); -- 设置主键 阅读全文
摘要:
准备测试数据 DROP TABLE IF EXISTS "tbl"; create table tbl(id int, js jsonb); create index idx_tbl_1 on tbl using gin (js jsonb_path_ops); create index idx_t 阅读全文