Explicitly mark short perftest queries

This commit is contained in:
Alexander Kuzmenkov 2020-06-23 15:09:54 +03:00
parent 1c1e12f06b
commit bfba15d512
17 changed files with 208 additions and 175 deletions

View File

@ -247,6 +247,7 @@ do
sed -n "s/^report-threshold/$test_name/p" < "$test_file" >> "analyze/report-thresholds.tsv"
sed -n "s/^skipped/$test_name/p" < "$test_file" >> "analyze/skipped-tests.tsv"
sed -n "s/^display-name/$test_name/p" < "$test_file" >> "analyze/query-display-names.tsv"
sed -n "s/^short/$test_name/p" < "$test_file" >> "analyze/marked-short-queries.tsv"
done
unset IFS
@ -354,7 +355,7 @@ create table queries engine File(TSVWithNamesAndTypes, 'report/queries.tsv')
-- we just skip the query. If there is a significant regression, the
-- average will be above threshold, we'll process it normally and will
-- detect the regression.
(left + right) / 2 < 0.02 as short,
right < 0.02 as short,
not short and abs(diff) > report_threshold and abs(diff) > stat_threshold as changed_fail,
not short and abs(diff) > report_threshold - 0.05 and abs(diff) > stat_threshold as changed_show,
@ -508,6 +509,18 @@ create table all_query_metrics_tsv engine File(TSV, 'report/all-query-metrics.ts
stat_threshold, test, query_index, query_display_name
from query_metric_stats
order by test, query_index;
-- unmarked short queries
create table unmarked_short_queries
engine File(TSV, 'report/unmarked-short-queries.tsv')
as select right, test, query_index, query_display_name
from queries
where short
and (test, query_index) not in
(select * from file('analyze/marked-short-queries.tsv', TSV,
'test text, query_index int'))
order by test, query_index
;
" 2> >(tee -a report/errors.log 1>&2)

View File

@ -72,17 +72,26 @@ available_parameters = {} # { 'table': ['hits_10m', 'hits_100m'], ... }
for e in subst_elems:
available_parameters[e.find('name').text] = [v.text for v in e.findall('values/value')]
# Take care to keep the order of queries -- sometimes we have DROP IF EXISTS
# Takes parallel lists of templates, substitutes them with all combos of
# parameters. The set of parameters is determined based on the first list.
# Note: keep the order of queries -- sometimes we have DROP IF EXISTS
# followed by CREATE in create queries section, so the order matters.
def substitute_parameters(query_templates):
result = []
for q in query_templates:
def substitute_parameters(query_templates, *other_templates):
query_results = []
other_results = [[]] * (len(other_templates))
for i, q in enumerate(query_templates):
keys = set(n for _, n, _, _ in string.Formatter().parse(q) if n)
values = [available_parameters[k] for k in keys]
result.extend([
q.format(**dict(zip(keys, values_combo)))
for values_combo in itertools.product(*values)])
return result
combos = itertools.product(*values)
for c in combos:
with_keys = dict(zip(keys, c))
query_results.append(q.format(**with_keys))
for j, t in enumerate(other_templates):
other_results[j].append(t[i].format(**with_keys))
if len(other_templates):
return query_results, *other_results
else:
return query_results
report_stage_end('substitute')
@ -147,12 +156,26 @@ for c in connections:
report_stage_end('fill')
# Run test queries
test_query_templates = [q.text for q in root.findall('query')]
test_queries = substitute_parameters(test_query_templates)
# Build a list of test queries, substituting parameters to query templates,
# and reporting the queries marked as short.
test_queries = []
for e in root.findall('query'):
new_queries = []
if 'short' in e.attrib:
new_queries, short = substitute_parameters([e.text], [e.attrib['short']])
print(new_queries)
print(short)
for i, s in enumerate(short):
if eval(s):
print(f'short\t{i + len(test_queries)}')
else:
new_queries = substitute_parameters([e.text])
test_queries += new_queries
report_stage_end('substitute2')
# Run test queries.
for query_index, q in enumerate(test_queries):
query_prefix = f'{test_name}.query{query_index}'

View File

@ -192,6 +192,13 @@ if args.report == 'main':
['Client time, s', 'Server time, s', 'Ratio', 'Test', 'Query'],
slow_on_client_rows)
unmarked_short_rows = tsvRows('report/unmarked-short-queries.tsv')
error_tests += len(unmarked_short_rows)
printSimpleTable('Short queries not marked as short',
['New client time, s', 'Test', '#', 'Query'],
unmarked_short_rows)
def print_changes():
rows = tsvRows('report/changed-perf.tsv')
if not rows:

View File

@ -3,90 +3,90 @@
<table_exists>hits_100m_single</table_exists>
</preconditions>
<query>select min(Title) from hits_100m_single where Title != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(Title) from hits_100m_single where Title != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(Title) from hits_100m_single where Title != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(Title) from hits_100m_single where Title != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select min(URL) from hits_100m_single where URL != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(URL) from hits_100m_single where URL != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(URL) from hits_100m_single where URL != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(URL) from hits_100m_single where URL != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select min(Referer) from hits_100m_single where Referer != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(Referer) from hits_100m_single where Referer != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(Referer) from hits_100m_single where Referer != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(Referer) from hits_100m_single where Referer != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select min(FlashMinor2) from hits_100m_single where FlashMinor2 != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(FlashMinor2) from hits_100m_single where FlashMinor2 != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(FlashMinor2) from hits_100m_single where FlashMinor2 != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(FlashMinor2) from hits_100m_single where FlashMinor2 != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select min(MobilePhoneModel) from hits_100m_single where MobilePhoneModel != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(MobilePhoneModel) from hits_100m_single where MobilePhoneModel != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(MobilePhoneModel) from hits_100m_single where MobilePhoneModel != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(MobilePhoneModel) from hits_100m_single where MobilePhoneModel != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select min(Params) from hits_100m_single where Params != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(Params) from hits_100m_single where Params != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(Params) from hits_100m_single where Params != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(Params) from hits_100m_single where Params != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select min(SearchPhrase) from hits_100m_single where SearchPhrase != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(SearchPhrase) from hits_100m_single where SearchPhrase != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(SearchPhrase) from hits_100m_single where SearchPhrase != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(SearchPhrase) from hits_100m_single where SearchPhrase != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select min(PageCharset) from hits_100m_single where PageCharset != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(PageCharset) from hits_100m_single where PageCharset != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(PageCharset) from hits_100m_single where PageCharset != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(PageCharset) from hits_100m_single where PageCharset != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select min(SocialNetwork) from hits_100m_single where SocialNetwork != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(SocialNetwork) from hits_100m_single where SocialNetwork != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(SocialNetwork) from hits_100m_single where SocialNetwork != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(SocialNetwork) from hits_100m_single where SocialNetwork != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<!-- SocialAction is always empty in hits_100m_single, don't test it -->
<query>select min(SocialSourcePage) from hits_100m_single where SocialSourcePage != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(SocialSourcePage) from hits_100m_single where SocialSourcePage != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(SocialSourcePage) from hits_100m_single where SocialSourcePage != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(SocialSourcePage) from hits_100m_single where SocialSourcePage != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select min(ParamOrderID) from hits_100m_single where ParamOrderID != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(ParamOrderID) from hits_100m_single where ParamOrderID != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(ParamOrderID) from hits_100m_single where ParamOrderID != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(ParamOrderID) from hits_100m_single where ParamOrderID != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select min(OpenstatServiceName) from hits_100m_single where OpenstatServiceName != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(OpenstatServiceName) from hits_100m_single where OpenstatServiceName != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(OpenstatServiceName) from hits_100m_single where OpenstatServiceName != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(OpenstatServiceName) from hits_100m_single where OpenstatServiceName != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select min(OpenstatCampaignID) from hits_100m_single where OpenstatCampaignID != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(OpenstatCampaignID) from hits_100m_single where OpenstatCampaignID != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(OpenstatCampaignID) from hits_100m_single where OpenstatCampaignID != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(OpenstatCampaignID) from hits_100m_single where OpenstatCampaignID != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select min(OpenstatAdID) from hits_100m_single where OpenstatAdID != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(OpenstatAdID) from hits_100m_single where OpenstatAdID != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(OpenstatAdID) from hits_100m_single where OpenstatAdID != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(OpenstatAdID) from hits_100m_single where OpenstatAdID != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select min(OpenstatSourceID) from hits_100m_single where OpenstatSourceID != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(OpenstatSourceID) from hits_100m_single where OpenstatSourceID != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(OpenstatSourceID) from hits_100m_single where OpenstatSourceID != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(OpenstatSourceID) from hits_100m_single where OpenstatSourceID != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select min(UTMSource) from hits_100m_single where UTMSource != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(UTMSource) from hits_100m_single where UTMSource != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(UTMSource) from hits_100m_single where UTMSource != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(UTMSource) from hits_100m_single where UTMSource != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select min(UTMMedium) from hits_100m_single where UTMMedium != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(UTMMedium) from hits_100m_single where UTMMedium != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(UTMMedium) from hits_100m_single where UTMMedium != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(UTMMedium) from hits_100m_single where UTMMedium != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select min(UTMCampaign) from hits_100m_single where UTMCampaign != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(UTMCampaign) from hits_100m_single where UTMCampaign != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(UTMCampaign) from hits_100m_single where UTMCampaign != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(UTMCampaign) from hits_100m_single where UTMCampaign != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select min(UTMContent) from hits_100m_single where UTMContent != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(UTMContent) from hits_100m_single where UTMContent != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(UTMContent) from hits_100m_single where UTMContent != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(UTMContent) from hits_100m_single where UTMContent != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select min(UTMTerm) from hits_100m_single where UTMTerm != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(UTMTerm) from hits_100m_single where UTMTerm != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(UTMTerm) from hits_100m_single where UTMTerm != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(UTMTerm) from hits_100m_single where UTMTerm != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select min(FromTag) from hits_100m_single where FromTag != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select max(FromTag) from hits_100m_single where FromTag != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select any(FromTag) from hits_100m_single where FromTag != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<query>select anyHeavy(FromTag) from hits_100m_single where FromTag != '' group by intHash32(UserID) % 1000000 FORMAT Null</query>
<substitutions>
<substitution>
<name>group_scale</name>
<value>1000000</value>
</substitution>
</substitutions>
<query>select min(Title) from hits_100m_single where Title != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select max(Title) from hits_100m_single where Title != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select any(Title) from hits_100m_single where Title != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select anyHeavy(Title) from hits_100m_single where Title != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select min(URL) from hits_100m_single where URL != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select max(URL) from hits_100m_single where URL != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select any(URL) from hits_100m_single where URL != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select anyHeavy(URL) from hits_100m_single where URL != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select min(Referer) from hits_100m_single where Referer != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select max(Referer) from hits_100m_single where Referer != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select any(Referer) from hits_100m_single where Referer != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select anyHeavy(Referer) from hits_100m_single where Referer != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select min(FlashMinor2) from hits_100m_single where FlashMinor2 != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select max(FlashMinor2) from hits_100m_single where FlashMinor2 != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select any(FlashMinor2) from hits_100m_single where FlashMinor2 != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select anyHeavy(FlashMinor2) from hits_100m_single where FlashMinor2 != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select min(MobilePhoneModel) from hits_100m_single where MobilePhoneModel != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select max(MobilePhoneModel) from hits_100m_single where MobilePhoneModel != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select any(MobilePhoneModel) from hits_100m_single where MobilePhoneModel != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select anyHeavy(MobilePhoneModel) from hits_100m_single where MobilePhoneModel != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select min(Params) from hits_100m_single where Params != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select max(Params) from hits_100m_single where Params != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select any(Params) from hits_100m_single where Params != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select anyHeavy(Params) from hits_100m_single where Params != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select min(SearchPhrase) from hits_100m_single where SearchPhrase != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select max(SearchPhrase) from hits_100m_single where SearchPhrase != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select any(SearchPhrase) from hits_100m_single where SearchPhrase != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select anyHeavy(SearchPhrase) from hits_100m_single where SearchPhrase != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select min(PageCharset) from hits_100m_single where PageCharset != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select max(PageCharset) from hits_100m_single where PageCharset != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select any(PageCharset) from hits_100m_single where PageCharset != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select anyHeavy(PageCharset) from hits_100m_single where PageCharset != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<!-- SocialAction and SocialNetwork is always empty in hits_100m_single, don't test it -->
<query>select min(SocialSourcePage) from hits_100m_single where SocialSourcePage != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select max(SocialSourcePage) from hits_100m_single where SocialSourcePage != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select any(SocialSourcePage) from hits_100m_single where SocialSourcePage != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select anyHeavy(SocialSourcePage) from hits_100m_single where SocialSourcePage != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<!-- ParamOrderID is almost always empty in hits_100m_single (3k nonempty rows), don't test it -->
<query>select min(OpenstatServiceName) from hits_100m_single where OpenstatServiceName != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select max(OpenstatServiceName) from hits_100m_single where OpenstatServiceName != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select any(OpenstatServiceName) from hits_100m_single where OpenstatServiceName != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select anyHeavy(OpenstatServiceName) from hits_100m_single where OpenstatServiceName != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select min(OpenstatCampaignID) from hits_100m_single where OpenstatCampaignID != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select max(OpenstatCampaignID) from hits_100m_single where OpenstatCampaignID != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select any(OpenstatCampaignID) from hits_100m_single where OpenstatCampaignID != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select anyHeavy(OpenstatCampaignID) from hits_100m_single where OpenstatCampaignID != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select min(OpenstatAdID) from hits_100m_single where OpenstatAdID != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select max(OpenstatAdID) from hits_100m_single where OpenstatAdID != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select any(OpenstatAdID) from hits_100m_single where OpenstatAdID != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select anyHeavy(OpenstatAdID) from hits_100m_single where OpenstatAdID != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select min(OpenstatSourceID) from hits_100m_single where OpenstatSourceID != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select max(OpenstatSourceID) from hits_100m_single where OpenstatSourceID != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select any(OpenstatSourceID) from hits_100m_single where OpenstatSourceID != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select anyHeavy(OpenstatSourceID) from hits_100m_single where OpenstatSourceID != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select min(UTMSource) from hits_100m_single where UTMSource != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select max(UTMSource) from hits_100m_single where UTMSource != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select any(UTMSource) from hits_100m_single where UTMSource != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select anyHeavy(UTMSource) from hits_100m_single where UTMSource != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select min(UTMMedium) from hits_100m_single where UTMMedium != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select max(UTMMedium) from hits_100m_single where UTMMedium != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select any(UTMMedium) from hits_100m_single where UTMMedium != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select anyHeavy(UTMMedium) from hits_100m_single where UTMMedium != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select min(UTMCampaign) from hits_100m_single where UTMCampaign != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select max(UTMCampaign) from hits_100m_single where UTMCampaign != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select any(UTMCampaign) from hits_100m_single where UTMCampaign != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select anyHeavy(UTMCampaign) from hits_100m_single where UTMCampaign != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select min(UTMContent) from hits_100m_single where UTMContent != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select max(UTMContent) from hits_100m_single where UTMContent != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select any(UTMContent) from hits_100m_single where UTMContent != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select anyHeavy(UTMContent) from hits_100m_single where UTMContent != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select min(UTMTerm) from hits_100m_single where UTMTerm != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select max(UTMTerm) from hits_100m_single where UTMTerm != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select any(UTMTerm) from hits_100m_single where UTMTerm != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select anyHeavy(UTMTerm) from hits_100m_single where UTMTerm != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select min(FromTag) from hits_100m_single where FromTag != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select max(FromTag) from hits_100m_single where FromTag != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select any(FromTag) from hits_100m_single where FromTag != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
<query>select anyHeavy(FromTag) from hits_100m_single where FromTag != '' group by intHash32(UserID) % {group_scale} FORMAT Null</query>
</test>

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,4 @@
<test>
<query>SELECT boundingRatio(number, number) FROM numbers(1000000)</query>
<query>SELECT (argMax(number, number) - argMin(number, number)) / (max(number) - min(number)) FROM numbers(1000000)</query>
<query>SELECT boundingRatio(number, number) FROM numbers(100000000)</query>
<query>SELECT (argMax(number, number) - argMin(number, number)) / (max(number) - min(number)) FROM numbers(100000000)</query>
</test>

View File

@ -1,10 +1,10 @@
<test>
<preconditions>
<table_exists>test.hits</table_exists>
</preconditions>
<settings>
<max_threads>1</max_threads>
</settings>
<query>SELECT count() FROM test.hits WHERE NOT ignore(IPv4CIDRToRange(ClientIP, rand() % 33))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(IPv6CIDRToRange(ClientIP6, rand() % 33))</query>

View File

@ -31,18 +31,20 @@
<substitution>
<name>num_rows</name>
<values>
<value>1000000</value>
<value>20000000</value>
</values>
</substitution>
</substitutions>
<create_query>CREATE TABLE IF NOT EXISTS codec_{seq_type}_{type}_{codec} (n {type} CODEC({codec})) ENGINE = MergeTree PARTITION BY tuple() ORDER BY tuple();</create_query>
<create_query>system stop merges</create_query>
<!-- Using limit to make query finite, allowing it to be run multiple times in a loop, reducing mean error -->
<query>INSERT INTO codec_seq_{type}_{codec} (n) SELECT number/pi() FROM system.numbers LIMIT {num_rows} SETTINGS max_threads=1</query>
<query>INSERT INTO codec_mon_{type}_{codec} (n) SELECT number+sin(number) FROM system.numbers LIMIT {num_rows} SETTINGS max_threads=1</query>
<query>INSERT INTO codec_rnd_{type}_{codec} (n) SELECT (intHash64(number) - 4294967295)/pi() FROM system.numbers LIMIT {num_rows} SETTINGS max_threads=1</query>
<drop_query>system start merges</drop_query>
<drop_query>DROP TABLE IF EXISTS codec_{seq_type}_{type}_{codec}</drop_query>
</test>

View File

@ -31,7 +31,7 @@
<substitution>
<name>num_rows</name>
<values>
<value>1000000</value>
<value>20000000</value>
</values>
</substitution>
</substitutions>
@ -41,6 +41,7 @@
<fill_query>INSERT INTO codec_seq_{type}_{codec} (n) SELECT number/pi() FROM system.numbers LIMIT {num_rows} SETTINGS max_threads=1</fill_query>
<fill_query>INSERT INTO codec_mon_{type}_{codec} (n) SELECT number+sin(number) FROM system.numbers LIMIT {num_rows} SETTINGS max_threads=1</fill_query>
<fill_query>INSERT INTO codec_rnd_{type}_{codec} (n) SELECT (intHash64(number) - 4294967295)/pi() FROM system.numbers LIMIT {num_rows} SETTINGS max_threads=1</fill_query>
<fill_query>optimize table codec_{seq_type}_{type}_{codec} settings optimize_throw_if_noop = 1</fill_query>
<query>SELECT count(n) FROM codec_{seq_type}_{type}_{codec} WHERE ignore(n) == 0 LIMIT {num_rows} SETTINGS max_threads=1</query>

View File

@ -33,7 +33,7 @@
<substitution>
<name>num_rows</name>
<values>
<value>1000000</value>
<value>20000000</value>
</values>
</substitution>
</substitutions>
@ -43,6 +43,7 @@
<fill_query>INSERT INTO codec_seq_{type}_{codec} (n) SELECT number FROM system.numbers LIMIT {num_rows} SETTINGS max_threads=1</fill_query>
<fill_query>INSERT INTO codec_mon_{type}_{codec} (n) SELECT number*512+(intHash64(number)%512) FROM system.numbers LIMIT {num_rows} SETTINGS max_threads=1</fill_query>
<fill_query>INSERT INTO codec_rnd_{type}_{codec} (n) SELECT intHash64(number) FROM system.numbers LIMIT {num_rows} SETTINGS max_threads=1</fill_query>
<fill_query>optimize table codec_{seq_type}_{type}_{codec} settings optimize_throw_if_noop = 1</fill_query>
<query>SELECT count(n) FROM codec_{seq_type}_{type}_{codec} WHERE ignore(n) == 0 LIMIT {num_rows} SETTINGS max_threads=1</query>

View File

@ -8,24 +8,23 @@
</preconditions>
<query><![CDATA[SELECT count() FROM hits_100m_single WHERE URL < URL]]></query>
<query short="1"><![CDATA[SELECT count() FROM hits_100m_single WHERE URL < URL]]></query>
<query><![CDATA[SELECT count() FROM hits_100m_single WHERE URL < PageCharset]]></query>
<query><![CDATA[SELECT count() FROM hits_100m_single WHERE SearchPhrase < SearchPhrase SETTINGS max_threads = 2]]></query>
<query><![CDATA[SELECT count() FROM hits_100m_single WHERE SearchPhrase < URL]]></query>
<query><![CDATA[SELECT count() FROM hits_100m_single WHERE SearchPhrase < PageCharset SETTINGS max_threads = 2]]></query>
<query><![CDATA[SELECT count() FROM hits_100m_single WHERE notEmpty(SearchPhrase) AND SearchPhrase < SearchPhrase SETTINGS max_threads = 2]]></query>
<query short="1"><![CDATA[SELECT count() FROM hits_100m_single WHERE notEmpty(SearchPhrase) AND SearchPhrase < SearchPhrase SETTINGS max_threads = 2]]></query>
<query><![CDATA[SELECT count() FROM hits_100m_single WHERE notEmpty(SearchPhrase) AND SearchPhrase < URL]]></query>
<query><![CDATA[SELECT count() FROM hits_100m_single WHERE notEmpty(SearchPhrase) AND SearchPhrase < PageCharset SETTINGS max_threads = 2]]></query>
<query><![CDATA[SELECT count() FROM hits_100m_single WHERE MobilePhoneModel < MobilePhoneModel SETTINGS max_threads = 1]]></query>
<query short="1"><![CDATA[SELECT count() FROM hits_100m_single WHERE MobilePhoneModel < MobilePhoneModel SETTINGS max_threads = 1]]></query>
<query><![CDATA[SELECT count() FROM hits_100m_single WHERE MobilePhoneModel < URL]]></query>
<query><![CDATA[SELECT count() FROM hits_100m_single WHERE MobilePhoneModel < PageCharset SETTINGS max_threads = 2]]></query>
<query><![CDATA[SELECT count() FROM hits_100m_single WHERE notEmpty(MobilePhoneModel) AND MobilePhoneModel < MobilePhoneModel SETTINGS max_threads = 1]]></query>
<query short="1"><![CDATA[SELECT count() FROM hits_100m_single WHERE notEmpty(MobilePhoneModel) AND MobilePhoneModel < MobilePhoneModel SETTINGS max_threads = 1]]></query>
<query><![CDATA[SELECT count() FROM hits_100m_single WHERE notEmpty(MobilePhoneModel) AND MobilePhoneModel < URL]]></query>
<query><![CDATA[SELECT count() FROM hits_100m_single WHERE notEmpty(MobilePhoneModel) AND MobilePhoneModel < PageCharset SETTINGS max_threads = 2]]></query>
<query><![CDATA[SELECT count() FROM hits_100m_single WHERE PageCharset < PageCharset SETTINGS max_threads = 2]]></query>
<query short="1"><![CDATA[SELECT count() FROM hits_100m_single WHERE PageCharset < PageCharset SETTINGS max_threads = 2]]></query>
<query><![CDATA[SELECT count() FROM hits_100m_single WHERE PageCharset < URL]]></query>
<query><![CDATA[SELECT count() FROM hits_100m_single WHERE Title < Title]]></query>
<query short="1"><![CDATA[SELECT count() FROM hits_100m_single WHERE Title < Title]]></query>
<query><![CDATA[SELECT count() FROM hits_100m_single WHERE Title < URL]]></query>
<query><![CDATA[SELECT count() FROM hits_100m_single WHERE Title < PageCharset]]></query>

View File

@ -1,35 +1,35 @@
<test>
<preconditions>
<table_exists>test.hits</table_exists>
<table_exists>hits_100m_single</table_exists>
</preconditions>
<query>SELECT count() FROM test.hits WHERE NOT ignore(concat(URL, URL))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(concat(URL, SearchPhrase))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(concat(MobilePhoneModel, SearchPhrase))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(concat(URL, 'Hello'))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(concat('World', SearchPhrase))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(concat(MobilePhoneModel, 'Hello'))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(concat(PageCharset, 'a'))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(concat(URL, URL))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(concat(URL, SearchPhrase))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(concat(MobilePhoneModel, SearchPhrase))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(concat(URL, 'Hello'))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(concat('World', SearchPhrase))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(concat(MobilePhoneModel, 'Hello'))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(concat(PageCharset, 'a'))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(format('{{}}{{}}', URL, URL))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(format('{{}}{{}}', URL, SearchPhrase))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(format('{{}}{{}}', MobilePhoneModel, SearchPhrase))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(format('{{}}Hello', URL))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(format('World{{}}', SearchPhrase))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(format('{{}}Hello', MobilePhoneModel))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(format('{{}}a', PageCharset))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(format('{{}}{{}}', URL, URL))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(format('{{}}{{}}', URL, SearchPhrase))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(format('{{}}{{}}', MobilePhoneModel, SearchPhrase))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(format('{{}}Hello', URL))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(format('World{{}}', SearchPhrase))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(format('{{}}Hello', MobilePhoneModel))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(format('{{}}a', PageCharset))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(concat(URL, URL, URL))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(concat(URL, SearchPhrase, MobilePhoneModel))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(concat(URL, 'Hello', URL))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(concat('Hello', SearchPhrase, 'World'))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(concat(MobilePhoneModel, 'Hello', PageCharset))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(concat('a', PageCharset, 'b'))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(concat(URL, URL, URL))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(concat(URL, SearchPhrase, MobilePhoneModel))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(concat(URL, 'Hello', URL))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(concat('Hello', SearchPhrase, 'World'))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(concat(MobilePhoneModel, 'Hello', PageCharset))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(concat('a', PageCharset, 'b'))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(format('{{}}{{}}{{}}', URL, URL, URL))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(format('{{}}{{}}{{}}', URL, SearchPhrase, MobilePhoneModel))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(format('{{}}Hello{{}}', URL, URL))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(format('Hello{{}}World', SearchPhrase))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(format('{{}}Hello{{}}', MobilePhoneModel, PageCharset))</query>
<query>SELECT count() FROM test.hits WHERE NOT ignore(format('a{{}}b', PageCharset))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(format('{{}}{{}}{{}}', URL, URL, URL))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(format('{{}}{{}}{{}}', URL, SearchPhrase, MobilePhoneModel))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(format('{{}}Hello{{}}', URL, URL))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(format('Hello{{}}World', SearchPhrase))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(format('{{}}Hello{{}}', MobilePhoneModel, PageCharset))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(format('a{{}}b', PageCharset))</query>
</test>

View File

@ -1,13 +1,11 @@
<test>
<query>SELECT count() FROM zeros(100000000) WHERE NOT ignore(if(rand() % 2, toDateTime('2019-02-04 01:24:31'), toDate('2019-02-04')))</query>
<query>SELECT count() FROM zeros(100000000) WHERE NOT ignore(multiIf(rand() % 2, toDateTime('2019-02-04 01:24:31'), toDate('2019-02-04')))</query>
<query>SELECT count() FROM zeros(100000000) WHERE NOT ignore(if(rand() % 2, [toDateTime('2019-02-04 01:24:31')], [toDate('2019-02-04')]))</query>
<query>SELECT count() FROM zeros(100000000) WHERE NOT ignore(multiIf(rand() % 2, [toDateTime('2019-02-04 01:24:31')], [toDate('2019-02-04')]))</query>
<query>SELECT count() FROM zeros(1000000) WHERE NOT ignore(if(rand() % 2, toDateTime('2019-02-04 01:24:31'), toDate('2019-02-04')))</query>
<query>SELECT count() FROM zeros(1000000) WHERE NOT ignore(multiIf(rand() % 2, toDateTime('2019-02-04 01:24:31'), toDate('2019-02-04')))</query>
<query>SELECT count() FROM zeros(1000000) WHERE NOT ignore(if(rand() % 2, [toDateTime('2019-02-04 01:24:31')], [toDate('2019-02-04')]))</query>
<query>SELECT count() FROM zeros(1000000) WHERE NOT ignore(multiIf(rand() % 2, [toDateTime('2019-02-04 01:24:31')], [toDate('2019-02-04')]))</query>
<query>SELECT count() FROM zeros(1000000) WHERE NOT ignore(if(rand() % 2, toDateTime(rand()), toDate(rand())))</query>
<query>SELECT count() FROM zeros(1000000) WHERE NOT ignore(multiIf(rand() % 2, toDateTime(rand()), toDate(rand())))</query>
<query>SELECT count() FROM zeros(1000000) WHERE NOT ignore(if(rand() % 2, [toDateTime(rand())], [toDate(rand())]))</query>
<query>SELECT count() FROM zeros(1000000) WHERE NOT ignore(multiIf(rand() % 2, [toDateTime(rand())], [toDate(rand())]))</query>
<query>SELECT count() FROM zeros(100000000) WHERE NOT ignore(if(rand() % 2, toDateTime(rand()), toDate(rand())))</query>
<query>SELECT count() FROM zeros(100000000) WHERE NOT ignore(multiIf(rand() % 2, toDateTime(rand()), toDate(rand())))</query>
<query>SELECT count() FROM zeros(100000000) WHERE NOT ignore(if(rand() % 2, [toDateTime(rand())], [toDate(rand())]))</query>
<query>SELECT count() FROM zeros(100000000) WHERE NOT ignore(multiIf(rand() % 2, [toDateTime(rand())], [toDate(rand())]))</query>
</test>

View File

@ -1,7 +1,4 @@
<test>
<substitutions>
<substitution>
<name>hash_func</name>
@ -20,8 +17,8 @@
</substitution>
</substitutions>
<query>SELECT {hash_func}(number, {buckets}) FROM numbers(1000000) FORMAT Null</query>
<query short="{buckets} &lt; 10">SELECT {hash_func}(number, {buckets}) FROM numbers(10000000) FORMAT Null</query>
<!-- sumbur with high bucket numbers is very slow, so only test two buckers -->
<query>SELECT sumburConsistentHash(toUInt32(number), 2) FROM numbers(1000000) FORMAT Null</query>
<query short="1">SELECT sumburConsistentHash(toUInt32(number), 2) FROM numbers(10000000) FORMAT Null</query>
</test>

View File

@ -52,17 +52,13 @@ PageCharset тоже почти всегда непуст, но его сред
<query>SELECT count() FROM hits_10m_single WHERE NOT ignore(cutQueryString(URL)) SETTINGS max_threads = 1</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(cutQueryString(URL))</query>
<!-- 38. Разные алгоритмы вычисления квантилей. -->
<query>SELECT quantilesIf(0.5, 0.9)(SendTiming, SendTiming > 0) FROM hits_10m_single SETTINGS max_threads = 1</query>
<query>SELECT quantilesIf(0.5, 0.9)(SendTiming, SendTiming > 0) FROM hits_100m_single</query>
<query>SELECT quantilesIf(0.5, 0.9)(SendTiming, SendTiming > 0) FROM hits_100m_single SETTINGS max_threads = 1</query>
<!-- 39. Разные алгоритмы вычисления квантилей. -->
<query>SELECT quantilesTimingIf(0.5, 0.9)(SendTiming, SendTiming > 0) FROM hits_10m_single SETTINGS max_threads = 1</query>
<query>SELECT quantilesTimingIf(0.5, 0.9)(SendTiming, SendTiming > 0) FROM hits_100m_single</query>
<query>SELECT quantilesTimingIf(0.5, 0.9)(SendTiming, SendTiming > 0) FROM hits_100m_single SETTINGS max_threads = 1</query>
<!-- 40. Разные алгоритмы вычисления квантилей. -->
<query>SELECT quantilesExactIf(0.5, 0.9)(SendTiming, SendTiming > 0) FROM hits_10m_single SETTINGS max_threads = 1</query>
<query>SELECT quantilesExactIf(0.5, 0.9)(SendTiming, SendTiming > 0) FROM hits_100m_single</query>
<query>SELECT quantilesExactIf(0.5, 0.9)(SendTiming, SendTiming > 0) FROM hits_100m_single SETTINGS max_threads = 1</query>
<!-- 41. Разные алгоритмы вычисления квантилей. -->
<query>SELECT quantilesTDigestIf(0.5, 0.9)(SendTiming, SendTiming > 0) FROM hits_10m_single SETTINGS max_threads = 1</query>
<query>SELECT quantilesTDigestIf(0.5, 0.9)(SendTiming, SendTiming > 0) FROM hits_100m_single</query>
<query>SELECT quantilesTDigestIf(0.5, 0.9)(SendTiming, SendTiming > 0) FROM hits_100m_single SETTINGS max_threads = 1</query>
<!-- 42. Разные алгоритмы вычисления кардинальности. -->
<query>SELECT uniq(UserID) FROM hits_10m_single SETTINGS max_threads = 1</query>
<query>SELECT uniq(UserID) FROM hits_100m_single</query>

View File

@ -1,10 +1,7 @@
<test>
<preconditions>
<table_exists>test.hits</table_exists>
<table_exists>hits_100m_single</table_exists>
</preconditions>
<query>SELECT count() FROM test.hits WHERE NOT ignore(toDate(toString(EventDate)))</query>
<query>SELECT count() FROM hits_100m_single WHERE NOT ignore(toDate(toString(EventDate)))</query>
</test>

View File

@ -1,17 +1,18 @@
<test>
<preconditions>
<table_exists>hits_100m_single</table_exists>
</preconditions>
<settings>
<max_threads>1</max_threads>
</settings>
<create_query>CREATE TABLE dt (x DateTime) ENGINE = MergeTree ORDER BY tuple()</create_query>
<create_query>CREATE TABLE dt64 (x DateTime64(3)) ENGINE = MergeTree ORDER BY tuple()</create_query>
<fill_query>INSERT INTO dt SELECT EventTime FROM hits_100m_single</fill_query>
<fill_query>INSERT INTO dt64 SELECT toDateTime64(toDecimal64(toUInt64(EventTime), 3) + toDecimal64((rand() % 1000) / 1000, 3), 3) FROM hits_100m_single</fill_query>
<query>SELECT count() FROM dt where not ignore(x)</query>
<query>SELECT count() FROM dt64 where not ignore(x)</query>
<query>SELECT max(x) FROM dt</query>