summaryrefslogtreecommitdiff
path: root/sql/sql_explain.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '10.2' into 10.3Sergei Golubchik2018-06-301-2/+1
|\
| * Merge branch '10.1' into 10.2Sergei Golubchik2018-06-211-2/+1
| |\
| | * MDEV-16191: Analyze format=json gives incorrect value for r_limit inside a ↵Varun Gupta2018-06-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dependent subquery when ORDER BY is present Currently for setting r_limit we divide with the number of iterations we invoke the dependent subquery. This is not needed for the case of limit. For varying limits we produce the output that the limit varies with execution. Also there is a type for filtered , we forgot to multiply by 100 as it is represented as a percent.
* | | MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from ↵Vladislav Vaintroub2018-02-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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.
* | | Merge bb-10.2-ext into 10.3Marko Mäkelä2018-01-041-1/+7
|\ \ \
| * \ \ Merge remote-tracking branch 'origin/10.2' into bb-10.2-extMonty2018-01-011-1/+7
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: cmake/make_dist.cmake.in mysql-test/r/func_json.result mysql-test/r/ps.result mysql-test/t/func_json.test mysql-test/t/ps.test sql/item_cmpfunc.h
| | * | MDEV-10844: EXPLAIN FORMAT=JSON doesn't show order direction for filesortVarun Gupta2017-12-301-1/+7
| | | | | | | | | | | | | | | | | | | | Currently explain format=json does not show the order direction of fields used during filesort. This patch would remove this limitation
* | | | Changed "const row not found" to "Const row not found"Monty2017-12-021-3/+3
| | | | | | | | | | | | | | | | | | | | Also changed Unique row not found to use uppercase first. This was done to make these messages consistent with the rest
* | | | Handle failures from mallocMichael Widenius2017-11-171-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most "new" failures fixed in the following files: - sql_select.cc - item.cc - item_func.cc - opt_subselect.cc Other things: - Allocate udf_handler strings in mem_root - Required changes in sql_string.h - Add mem_root as argument to some new [] calls - Mark udf_handler strings as thread specific - Removed some comment blocks with code
* | | | Changed KEY names to use LEX_CSTRINGMichael Widenius2017-08-241-2/+3
| | | |
* | | | Enusure that my_global.h is included firstMichael Widenius2017-08-241-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-07-071-2/+5
|\ \ \ | |/ /
| * | Merge 10.1 into 10.2Marko Mäkelä2017-07-061-2/+5
| |\ \ | | |/
| | * Fix warning discovered by ASANEugene Kosov2017-07-051-2/+5
| | | | | | | | | | | | | | | | | | | | | Patch submitted by Eugene Kosov <claprix@yandex.ru>, comments added by commiter. Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
* | | Changing field::field_name and Item::name to LEX_CSTRINGMonty2017-04-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Benefits of this patch: - Removed a lot of calls to strlen(), especially for field_string - Strings generated by parser are now const strings, less chance of accidently changing a string - Removed a lot of calls with LEX_STRING as parameter (changed to pointer) - More uniform code - Item::name_length was not kept up to date. Now fixed - Several bugs found and fixed (Access to null pointers, access of freed memory, wrong arguments to printf like functions) - Removed a lot of casts from (const char*) to (char*) Changes: - This caused some ABI changes - lex_string_set now uses LEX_CSTRING - Some fucntions are now taking const char* instead of char* - Create_field::change and after changed to LEX_CSTRING - handler::connect_string, comment and engine_name() changed to LEX_CSTRING - Checked printf() related calls to find bugs. Found and fixed several errors in old code. - A lot of changes from LEX_STRING to LEX_CSTRING, especially related to parsing and events. - Some changes from LEX_STRING and LEX_STRING & to LEX_CSTRING* - Some changes for char* to const char* - Added printf argument checking for my_snprintf() - Introduced null_clex_str, star_clex_string, temp_lex_str to simplify code - Added item_empty_name and item_used_name to be able to distingush between items that was given an empty name and items that was not given a name This is used in sql_yacc.yy to know when to give an item a name. - select table_name."*' is not anymore same as table_name.* - removed not used function Item::rename() - Added comparision of item->name_length before some calls to my_strcasecmp() to speed up comparison - Moved Item_sp_variable::make_field() from item.h to item.cc - Some minimal code changes to avoid copying to const char * - Fixed wrong error message in wsrep_mysql_parse() - Fixed wrong code in find_field_in_natural_join() where real_item() was set when it shouldn't - ER_ERROR_ON_RENAME was used with extra arguments. - Removed some (wrong) ER_OUTOFMEMORY, as alloc_root will already give the error. TODO: - Check possible unsafe casts in plugin/auth_examples/qa_auth_interface.c - Change code to not modify LEX_CSTRING for database name (as part of lower_case_table_names)
* | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-03-311-1/+1
|\ \ \ | |/ /
| * | Merge branch '10.1' into 10.2Sergei Golubchik2017-03-301-1/+1
| |\ \ | | |/
| | * Correct FSF addressiangilfillan2017-03-101-1/+1
| | |
* | | MDEV-10141: Add support for INTERSECT (and common parts for EXCEPT)Oleksandr Byelkin2017-03-141-3/+50
|/ / | | | | | | MDEV-10140: Add support for EXCEPT
* | MDEV-10372: EXPLAIN fixes for recursive CTEs, including FORMAT=JSONSergei Petrunia2016-08-081-1/+6
| | | | | | | | | | | | | | - Tabular EXPLAIN now prints "RECURSIVE UNION". - There is a basic implementation of EXPLAIN FORMAT=JSON. - it produces "recursive_union" JSON struct - No other details or ANALYZE support, yet.
* | Merge branch '10.2' into 10.2-mdev9864Galina Shalygina2016-05-081-134/+116
| |
* | MDEV-9652: EXPLAIN FORMAT=JSON should show outer_ref_condSergei Petrunia2016-02-281-0/+6
|/ | | | Show outer_ref_condition in EXPLAIN FORMAT=JSON output.
* Fixed compile warnings on SolarisMonty2015-11-201-2/+2
|
* MDEV-8830: Weird output in the error logSergei Petrunia2015-10-051-1/+0
| | | | Remove debug printout that was accidentally left in place
* Fix typos in JSON MRR outputSergei Petrunia2015-09-241-0/+3
|
* MDEV-8829: Assertion `0' failed in Explain_table_access::tag_to_jsonSergei Petrunia2015-09-241-0/+38
| | | | - Add EXPLAIN/ANALYZE FORMAT=JSON handling for a few special cases.
* MDEV-7970: EXPLAIN FORMAT=JSON does not print HAVINGOleksandr Byelkin2015-09-181-1/+14
| | | | Printing non-trivial HAVING added.
* MDEV-6152: Remove calls to current_thd while creating ItemMonty2015-08-271-65/+93
| | | | | | | | - Part 3: Adding mem_root to push_back() and push_front() Other things: - Added THD as an argument to some partition functions. - Added memory overflow checking for XML tag's in read_xml()
* Stage 2 of MDEV-6152:Monty2015-08-211-34/+38
| | | | | | | | - Added mem_root to all calls to new Item - Added private method operator new(size_t size) to Item to ensure that we always use a mem_root when creating an item. This saves use once call to current_thd per Item creation
* MDEV-8010 - Avoid sql_alloc() in Items (Patch #1)Sergey Vojtovich2015-08-211-49/+56
| | | | | | | Added mandatory thd parameter to Item (and all derivative classes) constructor. Added thd parameter to all routines that may create items. Also removed "current_thd" from Item::Item. This reduced number of pthread_getspecific() calls from 290 to 177 per OLTP RO transaction.
* Tabular ANALYZE must get its data from execution trackerSergei Petrunia2015-07-021-2/+30
|
* MDEV-7811: EXPLAIN/ANALYZE FORMAT=JSON should show subquery cacheSergei Petrunia2015-07-011-16/+28
| | | | | | | Fixes over the original patch: - Fix variable/class/other names - Fix the JSON output to be in line with the output of other JSON constructs we produce
* MDEV-7811: EXPLAIN/ANALYZE FORMAT=JSON should show subquery cacheOleksandr Byelkin2015-06-301-1/+29
|
* MDEV-6995: EXPLAIN JSON and ORDER BY, GROUP BY, etcSergei Petrunia2015-06-061-39/+62
| | | | | - Make ANALYZE correctly remember and report filesort() calls - Temp.table use is collected but only basic info is reported.
* MDEV-7943 - pthread_getspecific() takes 0.76% in OLTP ROSergey Vojtovich2015-05-131-1/+1
| | | | | | Added THD argument to select_result and all derivative classes. This reduces number of pthread_getspecific calls from 796 to 776 per OLTP RO transaction.
* MDEV-7951 - sql_alloc() takes 0.25% in OLTP ROSergey Vojtovich2015-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | sql_alloc() has additional costs compared to direct mem_root allocation: - function call: it is defined in a separate translation unit and can't be inlined - it needs to call pthread_getspecific() to get THD::mem_root It is called dozens of times implicitely at least by: - List<>::push_back() - List<>::push_front() - new (for Sql_alloc derived classes) - sql_memdup() Replaced lots of implicit sql_alloc() calls with direct mem_root allocation, passing through THD pointer whenever it is needed. Number of sql_alloc() calls reduced 345 -> 41 per OLTP RO transaction. pthread_getspecific() overhead dropped 0.76 -> 0.59 sql_alloc() overhed dropped 0.25 -> 0.06
* Fix a typo, s/false/NULL/.Sergei Petrunia2015-04-141-1/+1
|
* MDEV-7836: ANALYZE FORMAT=JSON should provide info about GROUP/ORDER BYSergei Petrunia2015-04-121-2/+18
| | | | | Fix EXPLAIN FORMAT=JSON to produce output that's not worse than the tabular form.
* MergeSergei Petrunia2015-04-121-33/+26
|\
| * MDEV-7835: ANALYZE FORMAT=JSON should show buffer sizesOleksandr Byelkin2015-04-091-0/+1
| |
| * MDEV-7856: EXPLAIN FORMAT=JSON should show partitionsOleksandr Byelkin2015-04-091-33/+25
| |
* | MDEV-7836: ANALYZE FORMAT=JSON should provide info about GROUP/ORDER BYSergei Petrunia2015-04-121-58/+220
|/ | | | Provide basic info about sorting/grouping done by the queries.
* MDEV-7860: EXPLAIN FORMAT=JSON crashes for loose scan querySergei Petrunia2015-04-081-2/+8
| | | | | | | (Based on original patch by Sanja Byelkin) Make the code that produces JSON output handle LooseScan quick select. The output we produce is compatible with MySQL 5.6.
* MDEV-7899: 10.1 is 3% slower than 10.0 in OLTP ROSergei Petrunia2015-04-071-2/+2
| | | | | | | | | - Remove ANALYZE's timing code off the the execution path of regular SELECTs. - Improve the tracker that tracks counts/execution times of SELECTs or DML statements: = regular execution just increments counters = ANALYZE will also collect timings.
* MDEV-7904: ANALYZE FORMAT=JSON doesn't print r_rows for union outputSergei Petrunia2015-04-041-0/+17
| | | | Print r_rows. There is no table tracking for reading from tmp table, yet.
* MDEV-7833:ANALYZE FORMAT=JSON and Range checked for each recordOleksandr Byelkin2015-04-031-5/+101
|
* MDEV-7812: ANALYZE FORMAT=JSON UPDATE/DELETE doesnt print the r_total_time_msOleksandr Byelkin2015-03-291-1/+5
| | | | | | Tracking total time added in UPDATE/DELETE Fixed selectivity calculation in UPDATE/DELETE Macro definitions of time tracting fixed.
* MDEV-7648: Extra data in ANALYZE FORMAT=JSON $stmtSergei Petrunia2015-03-241-39/+5
| | | | | | Switch from relying on PERFORMANCE_SCHEMA to using our own hooks for counting the time spent reading rows from tables.
* MDEV-7648: Extra data in ANALYZE FORMAT=JSON $stmtSergei Petrunia2015-03-071-1/+46
| | | | | | | | | Show total execution time (r_total_time_ms) for various parts of the query: 1. time spent in SELECTs 2. time spent reading rows from storage engines #2 currently gets the data from P_S.
* MDEV-7674: ANALYZE shows r_rows=0Sergei Petrunia2015-03-071-16/+11
| | | | Change r_rows to be double