Disclaimer: PostgreSQL only... haven't used MySQL in over 8 years.
Also, you didn't seem to be targeting queries, but I thought I would offer it up anyway (maybe for anyone with a similar question).
This is a bit of a hack, but if you consider the following table:
create table foo (
id integer
);
create index foo_ix1 on foo (id);
insert into foo generate_series (1, 1000000);
This, as you might expect, will use the index:
explain
select * from foo
where id between 5 and 10;
Unless you have a function-based index for that specific function, applying ANY function to the column should make it impossible for the planner to use the index. Simple example:
explain
select * from foo
where id + 0 between 5 and 10;
I haven't changed the results, but I forced a full scan.
For text columns, for example, you can just append an empty string: text_field || ''.