Re: Query with variables very slow
Sorry I haven't made myself clear...yes the field is part of the primary key (in the example below is field4):
CREATE TABLE `table_name` (
`field1` varchar(4) NOT NULL DEFAULT '',
..
`field2` smallint(6) NOT NULL DEFAULT '0',
`field3` date DEFAULT NULL,
..
`field4` varchar(20) NOT NULL DEFAULT '',
..
PRIMARY KEY (`field1`,`field2`,`field3`,`field4`),
KEY `txkey` (`field1`,`field2`,`field4`),
KEY `txfield1` (`field1`),
KEY `txfield2` (`field2`),
KEY `txfield3` (`field4`),
KEY `txfield4` (`field6`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
I didn't create the table, I'm trying just to retrieve data from this table...I will try to increase the buffer to discover if there is an improvement.
Thanks
Gianni