Commit graph

16 commits

Author SHA1 Message Date
Varun Gupta
9cb55143ac Minor cleanup in the optimizer trace code.
More test coverage added for the optimizer trace.
2019-02-18 17:11:20 +05:30
Varun Gupta
be8709eb7b MDEV-6111 Optimizer Trace
This task involves the implementation for the optimizer trace.

This feature produces a trace for any SELECT/UPDATE/DELETE/,
which contains information about decisions taken by the optimizer during
the optimization phase (choice of table access method, various costs,
transformations, etc). This feature would help to tell why some decisions were
taken by the optimizer and why some were rejected.

Trace is session-local, controlled by the @@optimizer_trace variable.
To enable optimizer trace we need to write:
   set @@optimizer_trace variable= 'enabled=on';

To display the trace one can run:
   SELECT trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE;

This task also involves:
    MDEV-18489: Limit the memory used by the optimizer trace
    introduces a switch optimizer_trace_max_mem_size which limits
    the memory used by the optimizer trace. This was implemented by
    Sergei Petrunia.
2019-02-13 11:52:36 +05:30
Varun Gupta
6b979416e0 Extending the API for json_writer by introdcing
classes for Json_writer_object and Json_writer_array.
These classes will be used for the implementation
of the optimizer trace.
2019-02-13 11:52:35 +05:30
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
Michael Widenius
4aaa38d26e Enusure that my_global.h is included first
- Added sql/mariadb.h file that should be included first by files in sql
  directory, if sql_plugin.h is not used (sql_plugin.h adds SHOW variables
  that must be done before my_global.h is included)
- Removed a lot of include my_global.h from include files
- Removed include's of some files that my_global.h automatically includes
- Removed duplicated include's of my_sys.h
- Replaced include my_config.h with my_global.h
2017-08-24 01:05:44 +02:00
iangilfillan
f0ec34002a Correct FSF address 2017-03-10 18:21:29 +01:00
Vicențiu Ciorbaru
6560e9c3a8 MDEV-11711: ArmHF EXPLAIN JSON garbage longlong values printed
Make sure printing with snprintf uses the correct typed parameters.
2017-01-16 12:50:12 +02:00
Sergei Petrunia
2d65679384 MDEV-10665: Json_writer produces extra members in output
Fix an issue in Single_line_formatting_helper: flush_on_one_line()
didn't clean up the buffered items which could cause them to be
printed for the second time.

This can't be ever observed by a user (see MDEV text for details).
2016-08-25 19:47:38 +03:00
Sergei Petrunia
4938b82263 MDEV-7836: ANALYZE FORMAT=JSON should provide info about GROUP/ORDER BY
Provide basic info about sorting/grouping done by the queries.
2015-04-12 04:48:42 +03:00
Sergei Petrunia
eeef80d09f EXPLAIN FORMAT=JSON : Fix MDEV-7266, bug in pretty-printer
- Single_line_formatting_helper should not accidentally exit the
  DISABLED state. No JSON construct should be able to move the
  Single_line_formatting_helper from DISABLED state.
2014-12-06 20:13:38 +03:00
Sergei Petrunia
8722b6de4d Code cleanup 2014-12-02 02:14:17 +03:00
Sergei Petrunia
e235bb864d ANALYZE FORMAT=JSON: better output and tests
- Print r_loops
- Always print r_* members. Print NULL values if no scans took place
- Added testcases.
2014-11-29 03:07:24 +03:00
Sergei Petrunia
37c444e1a0 EXPLAIN FORMAT=JSON: further development
Writing JSON:
- Fix a bug in Single_line_formatting_helper
- Add Json_writer_nesting_guard - safety class

EXPLAIN JSON support
- Add basic subquery support
- Add tests for UNION/UNION ALL.
2014-11-27 19:32:48 +03:00
Sergei Petrunia
84485dbe7c MDEV-6109: EXPLAIN JSON
Add pretty-printing of possible_keys column.
2014-08-12 15:02:09 +04:00
Sergei Petrunia
33d53c4c24 MDEV-6109: EXPLAIN JSON
- Add first testcases
- Don't overquote when printing conditions
- Other small output fixes
2014-08-09 06:37:56 +04:00
Sergei Petrunia
5cfd3270ec MDEV-6109: EXPLAIN JSON
- First code, "EXPLAIN FORMAT=JSON stmt" and "ANALYZE FORMAT=JSON stmt"
  work for basic queries.  Complex constructs (e.g subqueries, etc) not
  yet supported.
- No test infrastructure yet
2014-05-27 21:04:45 +04:00