Commit graph

31 commits

Author SHA1 Message Date
Marko Mäkelä
6da14d7b4a Merge 10.3 into 10.4 2020-05-30 11:04:27 +03:00
Marko Mäkelä
dad7a8ee7d Merge 10.2 into 10.3 2020-05-27 17:10:39 +03:00
Marko Mäkelä
6a26e0c719 Merge 10.1 into 10.2 2020-05-26 13:01:34 +03:00
Varun Gupta
76f4ae8295 MDEV-21495: Conditional jump or move depends on uninitialised value in sel_arg_range_seq_next
Initialize the parameter PARAM::max_key_part when we iterate over the ranges to get estimates
from EITS.
2020-05-26 01:57:00 +05:30
Sergei Petrunia
7bc6735736 MDEV-22401: Optimizer trace: multi-component range is not printed correctly
KEY_MULTI_RANGE::range_flag does not have correct flag bits for
per-endpoint flags (NEAR_MIN, NEAR_MAX, NO_MIN_RANGE, NO_MAX_RANGE).
It only has bits for flags that describe both endpoints.
So
- Document this.
- Switch optimizer trace to using {start|end}_key.flag values, instead.
  This fixes the bug.
- Switch records_in_column_ranges() to doing that too. (This used to
  work, because KEY_MULTI_RANGE::range_flag had correct flag value
  for the last key component, and EITS only uses one-component
  pseudo-indexes)
2020-04-29 16:31:16 +03:00
Sergei Petrunia
37570e845b MDEV-20740: Odd computations in calculate_cond_selectivity_for_table
Make SEL_ARG graph traversal code in sel_arg_range_seq_next() set
max_key_parts first.

(Pushing to 10.4 first)
2019-10-04 20:18:31 +03:00
Varun Gupta
5e36f5dd00 MDEV-18741: Optimizer trace: multi-part key ranges are printed incorrectly
Changed the function append_range_all_keyparts to use sel_arg_range_seq_init / sel_arg_range_seq_next to produce ranges.
Also adjusted to print format for the ranges, now the ranges are printed as:
    (keypart1_min, keypart2_min,..)  OP (keypart1_name,keypart2_name, ..) OP (keypart1_max,keypart2_max, ..)

Also added more tests for range and index merge access for optimizer trace
2019-05-28 17:17:44 +05:30
Marko Mäkelä
be85d3e61b Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
Marko Mäkelä
26a14ee130 Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
Vicențiu Ciorbaru
f177f125d4 Merge branch '5.5' into 10.1 2019-05-11 19:15:57 +03:00
Michal Schorm
17b4f99928 Update FSF address
This commit is based on the work of Michal Schorm, rebased on the
earliest MariaDB version.

Th command line used to generate this diff was:

find ./ -type f \
  -exec sed -i -e 's/Foundation, Inc., 59 Temple Place, Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \
  -exec sed -i -e 's/Foundation, Inc. 59 Temple Place.* Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \
  -exec sed -i -e 's/MA.*.....-1307.*USA/MA 02110-1335 USA/g' {} \; \
  -exec sed -i -e 's/Foundation, Inc., 59 Temple/Foundation, Inc., 51 Franklin/g' {} \; \
  -exec sed -i -e 's/Place, Suite 330, Boston, MA.*02111-1307.*USA/Street, Fifth Floor, Boston, MA 02110-1335 USA/g' {} \; \
  -exec sed -i -e 's/MA.*.....-1307/MA 02110-1335/g' {} \;
2019-05-10 20:52:00 +03:00
Marko Mäkelä
7830fb7f45 Merge 10.2 into 10.3 2018-08-28 12:22:56 +03:00
Igor Babaev
4eac5df3fc MDEV-16934 Query with very large IN clause lists runs slowly
This patch introduces support for the system variable eq_range_index_dive_limit
that existed in MySQL starting from 5.6. The variable sets a limit for
index dives into equality ranges. Index dives are performed by optimizer
to estimate the number of rows in range scans. Index dives usually provide
good estimate but they are pretty expensive. To estimate the number of rows
in equality ranges statistical data on indexes can be employed. Its usage gives
not so good estimates but it's cheap. So if the number of equality dives
required by an index scan exceeds the set limit no dives for equality
ranges are performed by the optimizer for this index.

As the new system variable is introduced in a stable version the default
value for it is set to a special value meaning there is no limit for the number
of index dives performed by the optimizer.

The patch partially uses the MySQL code for WL 5957
'Statistics-based Range optimization for many ranges'.
2018-08-17 14:28:39 -07:00
Monty
2ccd6716fc Fix a lot of compiler warnings found by -Wunused 2018-04-26 17:35:12 +03:00
Vladislav Vaintroub
dc93ce8dea Windows : Fix truncation warnings in sql/ 2017-10-10 06:19:50 +00:00
iangilfillan
f0ec34002a Correct FSF address 2017-03-10 18:21:29 +01:00
Sergei Petrunia
0bb5d95542 MDEV-10325: Queries examines all rows of a tables when it should not
The problem was introduced by 1859caf60b:
  MDEV-10175: range optimizer calls records_in_range() for full extended keys

  Make the range optimizer not call records_in_range() when it would
  not give any benefit.

that patch used an incorrect way to check for full extended key. Now fixing
the check.
2016-07-12 21:49:16 +03:00
Sergei Petrunia
1859caf60b MDEV-10175: range optimizer calls records_in_range() for full extended keys
Make the range optimizer not call records_in_range() when it would
not give any benefit.
2016-06-03 14:43:08 +03:00
Sergei Golubchik
b7b5f6f1ab 10.0-monty merge
includes:
* remove some remnants of "Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING"
* introduce LOCK_share, now LOCK_ha_data is strictly for engines
* rea_create_table() always creates .par file (even in "frm-only" mode)
* fix a 5.6 bug, temp file leak on dummy ALTER TABLE
2013-07-21 16:39:19 +02:00
Michael Widenius
3143ad589a Push a lot of small fixes to get larger parts to compile 2013-05-21 22:00:08 +03:00
Michael Widenius
068c61978e Temporary commit of 10.0-merge 2013-03-26 00:03:13 +02:00
Igor Babaev
fc1c8ffdad The pilot patch for mwl#253. 2013-03-11 07:44:24 -07:00
Sergei Golubchik
7caa80c481 MDEV-3934 Assertion `((keypart_map+1) & keypart_map) == 0' failed in _mi_pack_key with an index on a POINT column
sel_arg_range_seq_next(): set keypart map also for GEOM_FLAG keys
2013-01-20 14:06:33 +01:00
Sergei Golubchik
5bf311e1e8 fix the include guards and add missing gplv2 headers 2012-02-17 12:19:38 +01:00
Sergei Golubchik
76f0b94bb0 merge with 5.3
sql/sql_insert.cc:
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
  ******
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
sql/sql_table.cc:
  small cleanup
  ******
  small cleanup
2011-10-19 21:45:18 +02:00
Sergei Golubchik
0accbd0364 lots of post-merge changes 2011-04-25 17:22:25 +02:00
Michael Widenius
52b64be318 Fixed compiler warnings
client/readline.cc:
  Initialize not used variable (to kill wrong compiler warning)
mysql-test/suite/handler/aria.result:
  Updated test result
mysql-test/suite/handler/handler.inc:
  Changed index to ensure rows are in a fixed order
mysql-test/suite/handler/heap.result:
  Updated test result
mysql-test/suite/handler/innodb.result:
  Updated test result
mysql-test/suite/handler/myisam.result:
  Updated test result
plugin/handler_socket/handlersocket/Makefile.am:
  Use CXX flags to compile
sql/filesort.cc:
  Initialize variable that may be used
sql/log.cc:
  Initialize not used variable (to kill wrong compiler warning)
sql/opt_range_mrr.cc:
  Fixed cast to avoid compiler warning
storage/xtradb/fil/fil0fil.c:
  Added cast to avoid compiler warning
2011-02-25 20:15:27 +02:00
Vladislav Vaintroub
fb47a163d4 Fix MYSQL Bug#60057 : sel_arg_range_seq_next loops in optimized compilation/VS2010
When mariadb 5.3 is compiler with VS2010, several tests would enter infinite loop in 
sel_arg_range_seq_next(). The reason is compiler backend bug. This bug is not
present in either VS2008  or VS2010 SP1 RC.

Workaround is to compile this function without most aggresive optimization flag
 (-Og )  using #pragma optimize ("g", {on|off}) for this version of MSVC compiler.
2011-02-12 17:17:19 +01:00
Sergey Petrunya
eafc4bef33 MWL#121-125 DS-MRR improvements
- Address review feedback: change return type of RANGE_SEQ_IF::next()
2010-12-13 20:01:32 +03:00
Sergey Petrunya
a285ce3e58 Post-merge fixes part 1 2010-10-10 17:38:17 +03:00
Sergey Petrunya
da5edf5057 MWL#67: MRR backport
- Make index condition pushdown be controlled by an @@optimizer_switch flag,
  not by @@engine_condition_pushdown
- Make MRR buffer size be controlled by @@mrr_buffer_size, not 
  by @@read_rnd_buffer_size
- Move parts of code to separate files
- Code cleanup
- Add --sorted_result to some SELECTs in tests.
2009-12-22 15:33:21 +03:00