Skip to content

Commit 556e4f6

Browse files
committed
speed up regression tests
1 parent 2df7533 commit 556e4f6

File tree

3 files changed

+237
-29
lines changed

3 files changed

+237
-29
lines changed

expected/pg_pathman.out

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,10 @@ begin
621621
perform test.pathman_equal((plan->0->'Plan'->'Plans'->1->'Relation Name')::text,
622622
'"runtime_test_1_1"',
623623
'wrong partition');
624+
625+
select count(*) from jsonb_array_elements_text(plan->0->'Plan'->'Plans') into num;
626+
perform test.pathman_equal(num::text, '2', 'expected 2 child plans for custom scan');
627+
624628
return 'ok';
625629
end;
626630
$$ language plpgsql;
@@ -629,7 +633,7 @@ declare
629633
plan jsonb;
630634
num int;
631635
begin
632-
plan = test.pathman_test('select * from test.runtime_test_1 where id = any (select * from test.run_values limit 6)');
636+
plan = test.pathman_test('select * from test.runtime_test_1 where id = any (select * from test.run_values limit 4)');
633637

634638
perform test.pathman_equal((plan->0->'Plan'->'Node Type')::text,
635639
'"Nested Loop"',
@@ -644,9 +648,9 @@ begin
644648
'wrong plan provider');
645649

646650
select count(*) from jsonb_array_elements_text(plan->0->'Plan'->'Plans'->1->'Plans') into num;
647-
perform test.pathman_equal(num::text, '6', 'expected 6 child plans for custom scan');
651+
perform test.pathman_equal(num::text, '4', 'expected 4 child plans for custom scan');
648652

649-
for i in 0..5 loop
653+
for i in 0..3 loop
650654
perform test.pathman_equal((plan->0->'Plan'->'Plans'->1->'Plans'->i->'Relation Name')::text,
651655
format('"runtime_test_1_%s"', i + 1),
652656
'wrong partition');
@@ -678,11 +682,11 @@ begin
678682
'wrong plan provider');
679683

680684
select count(*) from jsonb_array_elements_text(plan->0->'Plan'->'Plans'->1->'Plans') into num;
681-
perform test.pathman_equal(num::text, '128', 'expected 128 child plans for custom scan');
685+
perform test.pathman_equal(num::text, '6', 'expected 6 child plans for custom scan');
682686

683-
for i in 0..127 loop
687+
for i in 0..5 loop
684688
num = plan->0->'Plan'->'Plans'->1->'Plans'->i->'Actual Loops';
685-
perform test.pathman_assert(num <= 79, 'expected no more than 79 loops');
689+
perform test.pathman_assert(num > 0 and num <= 1667, 'expected no more than 1667 loops');
686690
end loop;
687691

688692
return 'ok';
@@ -694,7 +698,7 @@ declare
694698
num int;
695699
begin
696700
plan = test.pathman_test('select * from test.category c, lateral' ||
697-
'(select * from test.runtime_test_2 g where g.category_id = c.id order by rating limit 10) as tg');
701+
'(select * from test.runtime_test_2 g where g.category_id = c.id order by rating limit 4) as tg');
698702

699703
perform test.pathman_equal((plan->0->'Plan'->'Node Type')::text,
700704
'"Nested Loop"',
@@ -710,9 +714,9 @@ begin
710714
'wrong plan provider');
711715

712716
select count(*) from jsonb_array_elements_text(plan->0->'Plan'->'Plans'->1->'Plans'->0->'Plans') into num;
713-
perform test.pathman_equal(num::text, '10', 'expected 10 child plans for custom scan');
717+
perform test.pathman_equal(num::text, '4', 'expected 4 child plans for custom scan');
714718

715-
for i in 0..9 loop
719+
for i in 0..3 loop
716720
perform test.pathman_equal((plan->0->'Plan'->'Plans'->1->'Plans'->0->'Plans'->i->'Relation Name')::text,
717721
format('"runtime_test_2_%s"', i + 1),
718722
'wrong partition');
@@ -727,26 +731,26 @@ $$ language plpgsql;
727731
create table test.run_values as select generate_series(1, 10000) val;
728732
create table test.runtime_test_1(id serial primary key, val real);
729733
insert into test.runtime_test_1 select generate_series(1, 10000), random();
730-
select pathman.create_hash_partitions('test.runtime_test_1', 'id', 128);
734+
select pathman.create_hash_partitions('test.runtime_test_1', 'id', 6);
731735
NOTICE: function test.runtime_test_1_insert_trigger_func() does not exist, skipping
732736
NOTICE: function test.runtime_test_1_update_trigger_func() does not exist, skipping
733737
NOTICE: Copying data to partitions...
734738
create_hash_partitions
735739
------------------------
736-
128
740+
6
737741
(1 row)
738742

739-
create table test.category as (select id, 'cat' || id::text as name from generate_series(1, 10) id);
743+
create table test.category as (select id, 'cat' || id::text as name from generate_series(1, 4) id);
740744
create table test.runtime_test_2 (id serial, category_id int not null, name text, rating real);
741-
insert into test.runtime_test_2 (select id, (id % 10) + 1 as category_id, 'good' || id::text as name, random() as rating from generate_series(1, 1000000) id);
745+
insert into test.runtime_test_2 (select id, (id % 6) + 1 as category_id, 'good' || id::text as name, random() as rating from generate_series(1, 100000) id);
742746
create index on test.runtime_test_2 (category_id, rating);
743-
select pathman.create_hash_partitions('test.runtime_test_2', 'category_id', 128);
747+
select pathman.create_hash_partitions('test.runtime_test_2', 'category_id', 6);
744748
NOTICE: function test.runtime_test_2_insert_trigger_func() does not exist, skipping
745749
NOTICE: function test.runtime_test_2_update_trigger_func() does not exist, skipping
746750
NOTICE: Copying data to partitions...
747751
create_hash_partitions
748752
------------------------
749-
128
753+
6
750754
(1 row)
751755

752756
analyze test.run_values;
@@ -784,7 +788,7 @@ set pg_pathman.enable_runtimemergeappend = off;
784788
set enable_mergejoin = on;
785789
set enable_hashjoin = on;
786790
drop table test.run_values, test.runtime_test_1, test.runtime_test_2 cascade;
787-
NOTICE: drop cascades to 256 other objects
791+
NOTICE: drop cascades to 12 other objects
788792
/*
789793
* Test split and merge
790794
*/

pathman.creator.user

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE QtCreatorProject>
3+
<!-- Written by QtCreator 4.0.0, 2016-05-19T15:39:05. -->
4+
<qtcreator>
5+
<data>
6+
<variable>EnvironmentId</variable>
7+
<value type="QByteArray">{d0be81a6-e8c4-4afa-91d0-36ea6e700d26}</value>
8+
</data>
9+
<data>
10+
<variable>ProjectExplorer.Project.ActiveTarget</variable>
11+
<value type="int">0</value>
12+
</data>
13+
<data>
14+
<variable>ProjectExplorer.Project.EditorSettings</variable>
15+
<valuemap type="QVariantMap">
16+
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
17+
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
18+
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
19+
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
20+
<value type="QString" key="language">Cpp</value>
21+
<valuemap type="QVariantMap" key="value">
22+
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
23+
</valuemap>
24+
</valuemap>
25+
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
26+
<value type="QString" key="language">QmlJS</value>
27+
<valuemap type="QVariantMap" key="value">
28+
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
29+
</valuemap>
30+
</valuemap>
31+
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
32+
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
33+
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
34+
<value type="int" key="EditorConfiguration.IndentSize">4</value>
35+
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
36+
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
37+
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
38+
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
39+
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
40+
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
41+
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
42+
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
43+
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
44+
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
45+
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
46+
<value type="int" key="EditorConfiguration.TabSize">8</value>
47+
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
48+
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
49+
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
50+
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
51+
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
52+
<value type="bool" key="EditorConfiguration.inEntireDocument">true</value>
53+
</valuemap>
54+
</data>
55+
<data>
56+
<variable>ProjectExplorer.Project.PluginSettings</variable>
57+
<valuemap type="QVariantMap">
58+
<valuelist type="QVariantList" key="ClangStaticAnalyzer.SuppressedDiagnostics"/>
59+
</valuemap>
60+
</data>
61+
<data>
62+
<variable>ProjectExplorer.Project.Target.0</variable>
63+
<valuemap type="QVariantMap">
64+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
65+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
66+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{45ff1c95-c051-41bc-90a6-43e901521168}</value>
67+
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
68+
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
69+
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
70+
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
71+
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/dmitry/Projects/pg_pathman</value>
72+
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
73+
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
74+
<valuelist type="QVariantList" key="GenericProjectManager.GenericMakeStep.BuildTargets">
75+
<value type="QString">all</value>
76+
</valuelist>
77+
<value type="bool" key="GenericProjectManager.GenericMakeStep.Clean">false</value>
78+
<value type="QString" key="GenericProjectManager.GenericMakeStep.MakeArguments"></value>
79+
<value type="QString" key="GenericProjectManager.GenericMakeStep.MakeCommand"></value>
80+
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
81+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
82+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
83+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">GenericProjectManager.GenericMakeStep</value>
84+
</valuemap>
85+
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
86+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
87+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
88+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
89+
</valuemap>
90+
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
91+
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
92+
<valuelist type="QVariantList" key="GenericProjectManager.GenericMakeStep.BuildTargets">
93+
<value type="QString">clean</value>
94+
</valuelist>
95+
<value type="bool" key="GenericProjectManager.GenericMakeStep.Clean">true</value>
96+
<value type="QString" key="GenericProjectManager.GenericMakeStep.MakeArguments"></value>
97+
<value type="QString" key="GenericProjectManager.GenericMakeStep.MakeCommand"></value>
98+
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
99+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
100+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
101+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">GenericProjectManager.GenericMakeStep</value>
102+
</valuemap>
103+
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
104+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
105+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
106+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
107+
</valuemap>
108+
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
109+
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
110+
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
111+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">По умолчанию</value>
112+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">По умолчанию</value>
113+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">GenericProjectManager.GenericBuildConfiguration</value>
114+
</valuemap>
115+
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
116+
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
117+
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
118+
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
119+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Установка</value>
120+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
121+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
122+
</valuemap>
123+
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
124+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Локальная установка</value>
125+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
126+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
127+
</valuemap>
128+
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
129+
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
130+
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
131+
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
132+
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
133+
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
134+
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
135+
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
136+
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
137+
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
138+
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
139+
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
140+
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
141+
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
142+
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
143+
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
144+
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
145+
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
146+
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
147+
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
148+
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
149+
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
150+
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
151+
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
152+
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
153+
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
154+
<value type="int">0</value>
155+
<value type="int">1</value>
156+
<value type="int">2</value>
157+
<value type="int">3</value>
158+
<value type="int">4</value>
159+
<value type="int">5</value>
160+
<value type="int">6</value>
161+
<value type="int">7</value>
162+
<value type="int">8</value>
163+
<value type="int">9</value>
164+
<value type="int">10</value>
165+
<value type="int">11</value>
166+
<value type="int">12</value>
167+
<value type="int">13</value>
168+
<value type="int">14</value>
169+
</valuelist>
170+
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
171+
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
172+
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value>
173+
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
174+
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">%{buildDir}</value>
175+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Особая программа</value>
176+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
177+
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
178+
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
179+
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
180+
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
181+
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
182+
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
183+
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
184+
</valuemap>
185+
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
186+
</valuemap>
187+
</data>
188+
<data>
189+
<variable>ProjectExplorer.Project.TargetCount</variable>
190+
<value type="int">1</value>
191+
</data>
192+
<data>
193+
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
194+
<value type="int">18</value>
195+
</data>
196+
<data>
197+
<variable>Version</variable>
198+
<value type="int">18</value>
199+
</data>
200+
</qtcreator>

0 commit comments

Comments
 (0)