php - very small table hanging on "sorting results" -
i have table 50 rows in it. table linking document id type of document is. has primary key, no indexes, field name, 1 integer field, several boolean fields. query:
select id, name documenttypes deprecated != 1 order name asc has been on "sorting result" 7 minutes now. (this old table, , has never done before) rather table itself, seems indicates problem server or tangentially related table. what situation can cause small table hang on "sorting result"?
it pivot table, in context table being queried on own, generate list of documents.
here table:
create table `documenttypes` ( `id` int(3) not null, `name` varchar(1200) not null, `hidden` int(1) not null default '0', `numallowedper` int(2) not null, `pref1` int(1) not null default '0', `pref2` int(1) not null default '0', `deprecated` int(1) not null default '0', primary key (`id`) ) engine=innodb default charset=latin1 and results of explain
explain select id, name documenttypes deprecated != 1 order name asc possible_keys: null rows: 50 extra: using where; using filesort with or without index on deprecated should not take long run query. since there 50 rows, difference should negligible.
update
i has nothing table itself. question really, happening on server cause type of issue?
run following queries,
repair table documenttypes and
optimize table documenttypes
Comments
Post a Comment