*** /usr/ports/pobj/postgresql-11beta1/postgresql-11beta1/src/test/regress/expected/indexing.out Mon May 21 23:08:10 2018 --- /usr/ports/pobj/postgresql-11beta1/postgresql-11beta1/src/test/regress/results/indexing.out Thu May 24 17:59:15 2018 *************** *** 1101,1339 **** insert into fastpath select y.x, 'b' || (y.x/10)::text, 100 from (select generate_series(1,10000) as x) y; select md5(string_agg(a::text, b order by a, b asc)) from fastpath where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! 2ca216010a558a52d7df12f76dfc77ab ! (1 row) ! ! select md5(string_agg(a::text, b order by a desc, b desc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! 6167a852b3e0679886b84a5405b5b53d ! (1 row) ! ! select md5(string_agg(a::text, b order by b, a desc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! dfcf2bd5e5fea8397d47b2fd14618d31 ! (1 row) ! ! select md5(string_agg(a::text, b order by b, a asc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! 2ca216010a558a52d7df12f76dfc77ab ! (1 row) ! ! -- now create a multi-column index with both column asc ! create index fpindex2 on fastpath(a, b); ! truncate fastpath; ! insert into fastpath select y.x, 'b' || (y.x/10)::text, 100 from (select generate_series(1,10000) as x) y; ! -- again, vacuum here either forces index-only scans or creates fuzziness ! vacuum fastpath; ! select md5(string_agg(a::text, b order by a, b asc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! 2ca216010a558a52d7df12f76dfc77ab ! (1 row) ! ! select md5(string_agg(a::text, b order by a desc, b desc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! 6167a852b3e0679886b84a5405b5b53d ! (1 row) ! ! select md5(string_agg(a::text, b order by b, a desc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! dfcf2bd5e5fea8397d47b2fd14618d31 ! (1 row) ! ! select md5(string_agg(a::text, b order by b, a asc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! 2ca216010a558a52d7df12f76dfc77ab ! (1 row) ! ! -- same queries with a different kind of index now. the final result must not ! -- change irrespective of what kind of index we have. ! drop index fpindex2; ! create index fpindex3 on fastpath(a desc, b asc); ! truncate fastpath; ! insert into fastpath select y.x, 'b' || (y.x/10)::text, 100 from (select generate_series(1,10000) as x) y; ! vacuum fastpath; ! select md5(string_agg(a::text, b order by a, b asc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! 2ca216010a558a52d7df12f76dfc77ab ! (1 row) ! ! select md5(string_agg(a::text, b order by a desc, b desc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! 6167a852b3e0679886b84a5405b5b53d ! (1 row) ! ! select md5(string_agg(a::text, b order by b, a desc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! dfcf2bd5e5fea8397d47b2fd14618d31 ! (1 row) ! ! select md5(string_agg(a::text, b order by b, a asc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! 2ca216010a558a52d7df12f76dfc77ab ! (1 row) ! ! -- repeat again ! drop index fpindex3; ! create index fpindex4 on fastpath(a asc, b desc); ! truncate fastpath; ! insert into fastpath select y.x, 'b' || (y.x/10)::text, 100 from (select generate_series(1,10000) as x) y; ! vacuum fastpath; ! select md5(string_agg(a::text, b order by a, b asc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! 2ca216010a558a52d7df12f76dfc77ab ! (1 row) ! ! select md5(string_agg(a::text, b order by a desc, b desc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! 6167a852b3e0679886b84a5405b5b53d ! (1 row) ! ! select md5(string_agg(a::text, b order by b, a desc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! dfcf2bd5e5fea8397d47b2fd14618d31 ! (1 row) ! ! select md5(string_agg(a::text, b order by b, a asc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! 2ca216010a558a52d7df12f76dfc77ab ! (1 row) ! ! -- and again, this time indexing by (b, a). Note that column "b" has non-unique ! -- values. ! drop index fpindex4; ! create index fpindex5 on fastpath(b asc, a desc); ! truncate fastpath; ! insert into fastpath select y.x, 'b' || (y.x/10)::text, 100 from (select generate_series(1,10000) as x) y; ! vacuum fastpath; ! select md5(string_agg(a::text, b order by a, b asc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! 2ca216010a558a52d7df12f76dfc77ab ! (1 row) ! ! select md5(string_agg(a::text, b order by a desc, b desc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! 6167a852b3e0679886b84a5405b5b53d ! (1 row) ! ! select md5(string_agg(a::text, b order by b, a desc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! dfcf2bd5e5fea8397d47b2fd14618d31 ! (1 row) ! ! select md5(string_agg(a::text, b order by b, a asc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! 2ca216010a558a52d7df12f76dfc77ab ! (1 row) ! ! -- one last time ! drop index fpindex5; ! create index fpindex6 on fastpath(b desc, a desc); ! truncate fastpath; ! insert into fastpath select y.x, 'b' || (y.x/10)::text, 100 from (select generate_series(1,10000) as x) y; ! vacuum fastpath; ! select md5(string_agg(a::text, b order by a, b asc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! 2ca216010a558a52d7df12f76dfc77ab ! (1 row) ! ! select md5(string_agg(a::text, b order by a desc, b desc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! 6167a852b3e0679886b84a5405b5b53d ! (1 row) ! ! select md5(string_agg(a::text, b order by b, a desc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! dfcf2bd5e5fea8397d47b2fd14618d31 ! (1 row) ! ! select md5(string_agg(a::text, b order by b, a asc)) from fastpath ! where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! md5 ! ---------------------------------- ! 2ca216010a558a52d7df12f76dfc77ab ! (1 row) ! ! drop table fastpath; ! -- intentionally leave some objects around ! create table idxpart (a int) partition by range (a); ! create table idxpart1 partition of idxpart for values from (0) to (100); ! create table idxpart2 partition of idxpart for values from (100) to (1000) ! partition by range (a); ! create table idxpart21 partition of idxpart2 for values from (100) to (200); ! create table idxpart22 partition of idxpart2 for values from (200) to (300); ! create index on idxpart22 (a); ! create index on only idxpart2 (a); ! alter index idxpart2_a_idx attach partition idxpart22_a_idx; ! create index on idxpart (a); ! create table idxpart_another (a int, b int, primary key (a, b)) partition by range (a); ! create table idxpart_another_1 partition of idxpart_another for values from (0) to (100); ! -- Test that covering partitioned indexes work in various cases ! create table covidxpart (a int, b int) partition by list (a); ! create unique index on covidxpart (a) include (b); ! create table covidxpart1 partition of covidxpart for values in (1); ! create table covidxpart2 partition of covidxpart for values in (2); ! insert into covidxpart values (1, 1); ! insert into covidxpart values (1, 1); ! ERROR: duplicate key value violates unique constraint "covidxpart1_a_b_idx" ! DETAIL: Key (a)=(1) already exists. ! create table covidxpart3 (b int, c int, a int); ! alter table covidxpart3 drop c; ! alter table covidxpart attach partition covidxpart3 for values in (3); ! insert into covidxpart values (3, 1); ! insert into covidxpart values (3, 1); ! ERROR: duplicate key value violates unique constraint "covidxpart3_a_b_idx" ! DETAIL: Key (a)=(3) already exists. ! create table covidxpart4 (b int, a int); ! create unique index on covidxpart4 (a) include (b); ! create unique index on covidxpart4 (a); ! alter table covidxpart attach partition covidxpart4 for values in (4); ! insert into covidxpart values (4, 1); ! insert into covidxpart values (4, 1); ! ERROR: duplicate key value violates unique constraint "covidxpart4_a_b_idx" ! DETAIL: Key (a)=(4) already exists. --- 1101,1109 ---- insert into fastpath select y.x, 'b' || (y.x/10)::text, 100 from (select generate_series(1,10000) as x) y; select md5(string_agg(a::text, b order by a, b asc)) from fastpath where a >= 1000 and a < 2000 and b > 'b1' and b < 'b3'; ! WARNING: failed to resolve name __guard_local ! FATAL: fatal llvm error: Program used external function '__guard_local' which could not be resolved! ! server closed the connection unexpectedly ! This probably means the server terminated abnormally ! before or while processing the request. ! connection to server was lost ======================================================================