I have a simple ISAM table, about 2.2GB with 1.6 million records. For purposes of this question, the query is
SELECT 'one_unindexed_field' WHERE indexed_field > constant;
The only unusual thing about the table is that it has 1 large unindexed column VARCHAR(8192).
If 'one_unindexed_field' = the large VARCHAR field then the query takes about 7 times as long as the same query with any other field. This factor scales roughly the same for any number of records returned (say, 1000 to 100,000), so presumably you can assume the set of records returned fits into memory easily.
mysql> show global status like 'created_tmp_disk_tables';
reports that zero tmp_disk_tables are being created. EXPLAIN
returns the same results for either query.
How can I speed up my queries on this table? If it's not possible, can someone explain what is going on?
key_buffer_size=256M
tmp_table_size=64M
max_heap_table_size=64M
myisam_sort_buffer_size=88M
read_buffer_size=1M
read_rnd_buffer_size=2M
Edit: Got some hits suggesting that changing ROW_FORMAT to FIXED would probably speed up my query ... so I did that, and it actually made the query slightly slower.
Edit: I'm on Win10 64-bit, Server version: 5.7.16-log MySQL Community Server (GPL)
EXPLAIN returns this:
mysql> EXPLAIN SELECT skw_stk_vol FROM tbl_skews WHERE (tday_date >= 42795);
id 1
select_type SIMPLE
table tbl_skews
partitions NULL
type range
possible_keys ndx_skews_tday_date
key ndx_skews_tday_date
key_len 4
ref NULL
rows 406921
filtered 100
Extra Using index condition