Commit graph

11 commits

Author SHA1 Message Date
Varun Gupta
724ab9a1cb MDEV-16057: Using optimization Splitting with Group BY we see an unnecessary attached condition
t1.pk IS NOT NULL where pk is a PRIMARY KEY

For equalites in the WHERE clause we create a keyuse array that contains the set of all equalities.
For each KEYUSE inside the keyuse array we have a field "null_rejecting"
which tells that the equality will not hold if either the left or right
hand side of the equality is NULL.
If the equality is NULL rejecting then we accordingly add a NOT NULL condition for the field present in
the item val(present in the KEYUSE struct) when we are doing ref access.

For the optimization of splitting with GROUP BY we always set the null_rejecting to TRUE and we are doing ref access on
the GROUP by field. This does create a problem when the equality is NOT NULL rejecting. This happens in this case as
in the equality we have the right hand side as t1.pk where pk is a PRIMARY KEY , hence it is NOT NULLABLE. So we should have
null rejecting set to FALSE for such a case.
2018-05-06 23:05:37 +05:30
Igor Babaev
cff60be7fe MDEV-15899 Server crashes in st_join_table::is_inner_table_of_outer_join
The crash happened because JOIN::check_for_splittable_materialized()
called by mistake the function JOIN_TAB::is_inner_table_of_outer_join()
instead of the function TABLE_LIST::is_inner_table_of_outer_join().
The former cannot be called before the call of make_outerjoin_info().
2018-04-17 23:39:40 -07:00
Michael Widenius
ddc5764303 Remove compiler warnings
- Remove unused variables
- Mark variables unused
- Fix wrong types
- Add no-strict-aliasing to BUILD scripts
2018-04-16 20:16:43 +03:00
Monty
75dd94c7ce Fixed compiler warnings
Remove compiler warnings in sphinx, item_sum.cc and opt_split.cc
2018-03-29 14:19:48 +03:00
Vladislav Vaintroub
6c279ad6a7 MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from 'size_t' to 'type', possible loss of data)
Handle string length as size_t, consistently (almost always:))
Change function prototypes to accept size_t, where in the past
ulong or uint were used. change local/member variables to size_t
when appropriate.

This fix excludes rocksdb, spider,spider, sphinx and connect for now.
2018-02-06 12:55:58 +00:00
Igor Babaev
7a9611aee2 Fixed MDEV-14994 Assertion `join->best_read < double(1.79...15e+308L)' or
server crash in JOIN::fix_all_splittings_in_plan

Cost formulas must take into account the case when a splittable table
has now rows.
2018-01-30 21:12:11 -08:00
Igor Babaev
775aa5542d Fixed mdev-15017 Server crashes in in st_join_table::fix_splitting
Do not apply splitting for constant tables.
2018-01-29 23:56:28 -08:00
Igor Babaev
c5ac1f953b Fixed mdev-14880: Assertion `inj_cond_list.elements' failed
in JOIN::inject_best_splitting_cond

The value of SplM_opt_info::last_plan should be set to NULL
before any search for a splitting plan for a splittable
materialized table.
2018-01-08 15:22:17 -08:00
Vladislav Vaintroub
7a01e64c3a Fix warnings 2018-01-06 22:11:42 +00:00
Igor Babaev
86cf60a615 Fixed mdev-14845 Server crashes in st_join_table::is_inner_table_of_outer_join
Do not try to apply the splitting optimization to a materialized
derived if it's specified by a select with impossible where
or if all joined tables of this select are constant.
2018-01-02 14:09:16 -08:00
Igor Babaev
4f0299f8b3 This is a full cost-based implementation of the optimization that employs
splitting technique for equi-joins of materialized derived tables/views/CTEs.
(see mdev-13369 and mdev-13389).
2017-12-30 12:29:09 -08:00