Hi, I missed to attach the patch in my previous mail. Here i attach the patch.
With Regards, Ashutosh Sharma EnterpriseDB:http://www.enterprisedb.com On Tue, Aug 23, 2016 at 11:47 AM, Ashutosh Sharma <ashu.coe...@gmail.com> wrote: > Hi All, > > I have reverified the code coverage for hash index code using the test > file (commit-hash_coverage_test) attached with this mailing list and have > found that some of the code in _hash_squeezebucket() function flow is not > being covered. For this i have added a small testcase on top of 'commit > hash_coverage_test' patch. I have done this mainly to test Amit's WAL for > hash index patch [1]. > > I have also removed the warning message that we used to get for hash index > like 'WARNING: hash indexes are not WAL-logged and their use is > discouraged' as this message is now no more visible w.r.t hash index after > the WAL patch for hash index. Please have a look and let me know your > thoughts. > > [1] - https://www.postgresql.org/message-id/CAA4eK1JOBX% > 3DYU33631Qh-XivYXtPSALh514%2BjR8XeD7v%2BK3r_Q%40mail.gmail.com > > With Regards, > Ashutosh Sharma > EnterpriseDB:http://www.enterprisedb.com > > On Sat, Aug 6, 2016 at 9:41 AM, Amit Kapila <amit.kapil...@gmail.com> > wrote: > >> On Thu, Aug 4, 2016 at 7:24 PM, Mithun Cy <mithun...@enterprisedb.com> >> wrote: >> >>> I am attaching the patch to improve some coverage of hash index code [1]. >>> I have added some basic tests, which mainly covers overflow pages. It >>> took 2 sec extra time in my machine in parallel schedule. >>> >>> >>> >>> >>> Hit Total Coverage >>> old tests Line Coverage 780 1478 52.7 >>> >>> Function Coverage 63 85 74.1 >>> improvement after tests Line Coverage 1181 1478 79.9 % >>> >>> Function Coverage 78 85 91.8 % >>> >>> >> >> I think the code coverage improvement for hash index with these tests >> seems to be quite good, however time for tests seems to be slightly on >> higher side. Do anybody have better suggestion for these tests? >> >> diff --git a/src/test/regress/sql/concurrent_hash_index.sql >> b/src/test/regress/sql/concurrent_hash_index.sql >> I wonder why you have included a new file for these tests, why can't be >> these added to existing hash_index.sql. >> >> +-- >> +-- Cause some overflow insert and splits. >> +-- >> +CREATE TABLE con_hash_index_table (keycol INT); >> +CREATE INDEX con_hash_index on con_hash_index_table USING HASH (keycol); >> >> The relation name con_hash_index* choosen in above tests doesn't seem to >> be appropriate, how about hash_split_heap* or something like that. >> >> Register your patch in latest CF (https://commitfest.postgresql.org/10/) >> >> -- >> With Regards, >> Amit Kapila. >> EnterpriseDB: http://www.enterprisedb.com >> > >
diff --git a/src/test/regress/expected/concurrent_hash_index.out b/src/test/regress/expected/concurrent_hash_index.out index c3b8036..60191c0 100644 --- a/src/test/regress/expected/concurrent_hash_index.out +++ b/src/test/regress/expected/concurrent_hash_index.out @@ -3,7 +3,6 @@ -- CREATE TABLE con_hash_index_table (keycol INT); CREATE INDEX con_hash_index on con_hash_index_table USING HASH (keycol); -WARNING: hash indexes are not WAL-logged and their use is discouraged INSERT INTO con_hash_index_table VALUES (1); INSERT INTO con_hash_index_table SELECT * from con_hash_index_table; INSERT INTO con_hash_index_table SELECT * from con_hash_index_table; @@ -75,5 +74,15 @@ DROP TABLE hash_ovfl_temp_heap CASCADE; CREATE TABLE hash_ovfl_heap_float4 (x float4, y int); INSERT INTO hash_ovfl_heap_float4 VALUES (1.1,1); CREATE INDEX hash_idx ON hash_ovfl_heap_float4 USING hash (x); -WARNING: hash indexes are not WAL-logged and their use is discouraged DROP TABLE hash_ovfl_heap_float4 CASCADE; +-- +-- Test hash index insertion with squeeze bucket (XLOG_HASH_MOVE_PAGE_CONTENTS +-- WAL record type). +-- +CREATE TABLE hash_split_buckets (seqno int4, random int4); +CREATE INDEX hash_idx ON hash_split_buckets USING hash (random int4_ops) +with (fillfactor = 10); +INSERT INTO hash_split_buckets (seqno, random) SELECT a, a*5 FROM +GENERATE_SERIES(1, 100000) a; +REINDEX INDEX hash_idx; +DROP TABLE hash_split_buckets; diff --git a/src/test/regress/sql/concurrent_hash_index.sql b/src/test/regress/sql/concurrent_hash_index.sql index 8f930d5..d3b09d0 100644 --- a/src/test/regress/sql/concurrent_hash_index.sql +++ b/src/test/regress/sql/concurrent_hash_index.sql @@ -78,3 +78,15 @@ CREATE TABLE hash_ovfl_heap_float4 (x float4, y int); INSERT INTO hash_ovfl_heap_float4 VALUES (1.1,1); CREATE INDEX hash_idx ON hash_ovfl_heap_float4 USING hash (x); DROP TABLE hash_ovfl_heap_float4 CASCADE; + +-- +-- Test hash index insertion with squeeze bucket (XLOG_HASH_MOVE_PAGE_CONTENTS +-- WAL record type). +-- +CREATE TABLE hash_split_buckets (seqno int4, random int4); +CREATE INDEX hash_idx ON hash_split_buckets USING hash (random int4_ops) +with (fillfactor = 10); +INSERT INTO hash_split_buckets (seqno, random) SELECT a, a*5 FROM +GENERATE_SERIES(1, 100000) a; +REINDEX INDEX hash_idx; +DROP TABLE hash_split_buckets;
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers