Commit Graph

17 Commits

Author SHA1 Message Date
Nikolai Kochetov
b662dcdd0a added IColumn::select 2018-05-03 13:53:00 +03:00
Nikolai Kochetov
e9bc071837 default implementation for functions with ColumnWithDictionary arguments 2018-04-17 20:47:27 +03:00
Alexey Zatelepin
610f70fbeb forbid non-deterministic functions in primary and partition keys [#CLICKHOUSE-3455] 2018-02-21 20:54:16 +03:00
alexey-milovidov
c5dd6a9fed
Update IFunction.h 2018-02-09 22:20:18 +03:00
alexey-milovidov
1c308d7d6b
Update IFunction.h 2018-02-09 22:15:40 +03:00
Nikolai Kochetov
733450d1dd added more comments [#CLICKHOUSE-3550] 2018-02-08 20:20:10 +03:00
Nikolai Kochetov
27179b375a removed prerequisites [#CLICKHOUSE-3550] 2018-02-08 20:18:52 +03:00
Nikolai Kochetov
583ff32fe8 changed IFunction 2018-02-08 20:18:15 +03:00
Alexey Milovidov
bdd25b15bd Better [#CLICKHOUSE-2]. 2017-12-01 22:34:51 +03:00
Alexey Milovidov
bfdc108a08 Cleaning old code [#CLICKHOUSE-2]. 2017-07-25 01:44:13 +03:00
Alexey Milovidov
ee81d53bd5 Functions simplification [#CLICKHOUSE-2]. 2017-07-25 01:44:13 +03:00
alexey-milovidov
894d09f797 Update IFunction.h 2017-07-09 17:13:51 +03:00
Marek Vavruša
ff73394124 PKCondition: infer index use with pk subexpression
By default only constraints explicitly matching
primary key expression (or expression wrapped in
a monotonic function) are eligible for part and
range selection. So for example, if index is:

(toStartOfHour(dt), UserID)

Then a query such as this resorts to full scan:

SELECT count() FROM t WHERE dt = now()

Intuitively, only parts with toStartOfHour(now())
could be selected, but it is less trivial to prove.
The primary key currently can be wrapped in a chain
of monotonic functions, so following would work:

toStartOfHour(dt) = toStartOfHour(now()) AND dt = now()

It must be however explicitly stated, if we wanted
to infer that we’d have to know the inverse function,
and prove that the inverse function is monotonic
on given interval. This is not practical as
there is no inverse function that for example undos
rounding, it isn’t strictly monotonic.

There are however functions that don’t transform
output range and preserve monotonicity on the
complete input range, such as rounding or casts
to a same or wider numeric type. This eliminates
the need to find inverse function, as no check for monotonicity over arbitrary interval is needed,
and thus makes this optimisation possible.
2017-07-09 17:13:51 +03:00
Alexey Milovidov
77aa0ed3d2 Fixed build [#CLICKHOUSE-31]. 2017-06-13 07:33:07 +03:00
Alexey Milovidov
782fe332b1 Miscellaneous [#CLICKHOUSE-31]. 2017-06-13 07:13:54 +03:00
f1yegor
0bf5182020 translate comments: etc 2017-05-28 16:32:59 +02:00
Alexey Milovidov
310736cd7e Moved headers and sources to same place [#CLICKHOUSE-3]. 2017-04-01 12:22:42 +03:00