在范围搜索中,有符号整数比无符号整数慢吗?

if i have column(x) indexed tinyint signed and it only has numbers from -20 to 20 if i run this query

SELECT id
FROM table
WHERE x < 5

is it slower than running the same query on unsigned?

因为我认为

signed will be longer because x < 5 will search -128 < x < 5 -> 122 number

but if unsigned it will be 0 to 40

unsigned will be shorter because x < 5 will search 0 < x < 25 -> 26 number

评论