[MDEV-4649] SQL PARSER - unsigned number optimization - could return Impossible Where Created: 2013-06-13  Updated: 2015-11-17

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Minor
Reporter: roberto spadim Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: optimizer


 Description   

Hi guys, i found a optimization (maybe a bug?) that could be 'easly' optimized, check this query...

CREATE TABLE A (I INT UNSIGNED);
INSERT INTO A VALUES (1),(2),(3),(4)
EXPLAIN
SELECT COUNT(*)FROM A WHERE I<0

this return 4 rows...

but since "I" Column is unsigned it could return IMPOSSIBLE Where, right? (-1 don't exists to unsigned...)

i'm thinking about this optimization, and this other optimization (MDEV-4419) could allow some (many) queries to run faster

in SHOW STATUS LIKE 'handler_re%'
i see 4 rows being read when i execute the <0 query
in other words, it's reading data from disk (maybe a bug in optimizer)


Generated at Thu Feb 08 06:58:03 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.