MDEV-24813 Signal full scan to storage engines. - #3487
Conversation
|
|
701924a to
075f597
Compare
|
Also, I've tried this testcase create table t10 (a int, b varchar(100), index(a));
insert into t10 select seq, uuid() from seq_1_to_10000;
create table t11(a int);
explain insert into t11 select a from t10;
insert into t11 select a from t10;and init_read_record() isn't invoked for it. The index scan on t10 is initialized here: |
|
With this patch, we have "Using where with pushed condition" all over the place: |
075f597 to
97830d0
Compare
You are right. I had forgotten to make the call in join_read_first (and join_read_last). Added the calls to ha_extra in a new commit now. |
No longer the case with the new patch that does not comment out the cond_push if condition |
e9cd6a5 to
d0acb8e
Compare
d0acb8e to
654010e
Compare
654010e to
829a5e1
Compare
iMineLink
left a comment
There was a problem hiding this comment.
Please check my few minor comments, especially the ones around innodb_full_scan.test, thanks.
5cd6733 to
8ab8cc5
Compare
|
Thanks for addressing my review comments, LGTM. |
8ab8cc5 to
374d222
Compare
d3465cc to
5b84ca8
Compare
When starting to do a full table/index scan without a WHERE or JOIN condition, tell the storage engine so and the corresponding ulong-truncated LIMIT. Include an innodb implementation: added an innodb switch table_lock_on_full_scan, so that when the switch is on, on receiving the full scan signal from the sql layer, if the truncated LIMIT is ULONG_MAX (likely no LIMIT), attempt to acquire a table lock. Updated tests that have different results with the switch on. The three deadlock_*_race tests cannot reach their DEBUG_SYNC race under a table lock (it degenerates to a timeout), and the three I_S tests only restate a lock-mode change already covered by innodb_full_scan.test. (Comment and code edited by Sergei Petrunia <sergey@mariadb.com> and Thirunarayanan Balathandayuthapani <thiru@mariadb.com>)
For windows %p in `fprintf(f, "TRANSACTION (%p)", trx);` is not
prefixed with 0x, so we add a replacement /TRANSACTION
\([0-9A-F]{8}[0-9A-F]*\)/TRANSACTION (0xTHD)/. We use 8 as the minimum
length because not requiring one could cause something like
TRANSACTION (3) to be replaced with TRANSACTION (0xTHD)
5b84ca8 to
dba0f5c
Compare
This is an initial patch for discussion.
Will work in the following minimal example
--source include/have_innodb.inc
CREATE TABLE t (a INT PRIMARY KEY) ENGINE=InnoDB;
insert into t values (42);
BEGIN;
SELECT * FROM t LOCK IN SHARE MODE; # will acquire S lock
COMMIT;
DROP TABLE t;