Hello xaprb,
thank you for the fast Replay, i will look in the Mysql manual.
Here a other Query , no index
mysql-slow.log
User@Host: FORUM @ localhost # Query_time: 0.038074 Lock_time: 0.000040 Rows_sent: 100 Rows_examined: 8010SET timestamp=1261154801;SELECT userid, username, email, homepage, regdate, userposts, showemail, usercanemail, receivepm, rankingpoints FROM bb2_users WHERE rankingpoints ORDER BY rankingpoints ASC LIMIT 0,100;
EXPLAIN
id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE bb2_users index NULL rankingpoints 8 NULL 100 Using where
possible_keys = Null
Key = rankingpoints
Table Structure
CREATE TABLE IF NOT EXISTS bb2_users
( userid
int(11) unsigned NOT NULL AUTO_INCREMENT, username
varchar(50) NOT NULL DEFAULT ‘’, password
varchar(50) NOT NULL DEFAULT ‘’, sha1_password
varchar(40) NOT NULL DEFAULT ‘’, email
varchar(150) NOT NULL DEFAULT ‘’, userposts
mediumint(7) unsigned NOT NULL DEFAULT ‘0’, groupcombinationid
int(11) unsigned NOT NULL DEFAULT ‘0’, rankid
int(11) unsigned NOT NULL DEFAULT ‘0’, title
varchar(50) NOT NULL DEFAULT ‘’, regdate
int(11) unsigned NOT NULL DEFAULT ‘0’, lastvisit
int(11) unsigned NOT NULL DEFAULT ‘0’, lastactivity
int(11) unsigned NOT NULL DEFAULT ‘0’, usertext
text NOT NULL, aufgabe
text NOT NULL, portrait
text NOT NULL, signature
text NOT NULL, disablesignature
tinyint(1) NOT NULL DEFAULT ‘0’, icq
varchar(30) NOT NULL DEFAULT ‘’, aim
varchar(30) NOT NULL DEFAULT ‘’, yim
varchar(30) NOT NULL DEFAULT ‘’, msn
varchar(30) NOT NULL DEFAULT ‘’, homepage
varchar(250) NOT NULL DEFAULT ‘’, birthday
date NOT NULL DEFAULT ‘0000-00-00’, avatarid
int(11) unsigned NOT NULL DEFAULT ‘0’, gender
tinyint(1) NOT NULL DEFAULT ‘0’, showemail
tinyint(1) NOT NULL DEFAULT ‘0’, admincanemail
tinyint(1) NOT NULL DEFAULT ‘1’, usercanemail
tinyint(1) NOT NULL DEFAULT ‘1’, invisible
tinyint(1) NOT NULL DEFAULT ‘0’, usecookies
tinyint(1) NOT NULL DEFAULT ‘1’, styleid
int(11) unsigned NOT NULL DEFAULT ‘0’, langid
int(11) NOT NULL DEFAULT ‘0’, activation
int(11) unsigned NOT NULL DEFAULT ‘0’, blocked
tinyint(1) NOT NULL DEFAULT ‘0’, daysprune
smallint(5) unsigned NOT NULL DEFAULT ‘0’, timezoneoffset
char(3) NOT NULL, startweek
tinyint(1) NOT NULL DEFAULT ‘0’, dateformat
varchar(10) NOT NULL DEFAULT ‘’, timeformat
varchar(10) NOT NULL DEFAULT ‘’, emailnotify
tinyint(1) NOT NULL DEFAULT ‘0’, notificationperpm
tinyint(1) NOT NULL DEFAULT ‘0’, buddylist
text NOT NULL, ignorelist
text NOT NULL, receivepm
tinyint(1) NOT NULL DEFAULT ‘1’, emailonpm
tinyint(1) NOT NULL DEFAULT ‘0’, pmpopup
tinyint(1) NOT NULL DEFAULT ‘0’, umaxposts
smallint(5) unsigned NOT NULL DEFAULT ‘0’, showsignatures
tinyint(1) NOT NULL DEFAULT ‘1’, showavatars
tinyint(1) NOT NULL DEFAULT ‘1’, showimages
tinyint(1) NOT NULL DEFAULT ‘1’, ratingcount
smallint(5) unsigned NOT NULL DEFAULT ‘0’, ratingpoints
mediumint(7) unsigned NOT NULL DEFAULT ‘0’, threadview
tinyint(1) NOT NULL DEFAULT ‘0’, useuseraccess
tinyint(1) NOT NULL DEFAULT ‘0’, isgroupleader
tinyint(1) NOT NULL DEFAULT ‘0’, rankgroupid
int(11) NOT NULL DEFAULT ‘0’, useronlinegroupid
int(11) NOT NULL DEFAULT ‘0’, allowsigsmilies
tinyint(1) NOT NULL DEFAULT ‘1’, allowsightml
tinyint(1) NOT NULL DEFAULT ‘0’, allowsigbbcode
tinyint(1) NOT NULL DEFAULT ‘1’, allowsigimages
tinyint(1) NOT NULL DEFAULT ‘1’, emailonapplication
tinyint(1) NOT NULL DEFAULT ‘0’, acpmode
tinyint(3) NOT NULL DEFAULT ‘1’, acppersonalmenu
tinyint(1) NOT NULL DEFAULT ‘0’, acpmenumarkfirst
tinyint(3) NOT NULL DEFAULT ‘0’, acpmenuhidelast
tinyint(3) NOT NULL DEFAULT ‘0’, usewysiwyg
tinyint(1) unsigned NOT NULL DEFAULT ‘0’, useawh
tinyint(3) unsigned NOT NULL DEFAULT ‘1’, pmtotalcount
int(11) unsigned NOT NULL DEFAULT ‘0’, pminboxcount
int(11) unsigned NOT NULL DEFAULT ‘0’, pmnewcount
int(11) unsigned NOT NULL DEFAULT ‘0’, pmunreadcount
int(11) unsigned NOT NULL DEFAULT ‘0’, ip_save
varchar(255) NOT NULL, reg_ipaddress
varchar(15) NOT NULL DEFAULT ‘’, guthaben
bigint(20) NOT NULL DEFAULT ‘0’, canedittitle
tinyint(1) NOT NULL DEFAULT ‘0’, gw_g
int(50) NOT NULL DEFAULT ‘0’, gw_v
varchar(50) NOT NULL DEFAULT ‘0’, gut_ava_ba
tinyint(1) NOT NULL DEFAULT ‘0’, gut_ava_ea
tinyint(1) NOT NULL DEFAULT ‘0’, Birthday_Bot
varchar(4) NOT NULL DEFAULT ‘’, loginlog
int(12) NOT NULL DEFAULT ‘0’, steuerkl
tinyint(1) NOT NULL DEFAULT ‘0’, hpblock
int(1) NOT NULL DEFAULT ‘0’, ut
int(1) NOT NULL DEFAULT ‘1’, acp_userpic
text NOT NULL, acp_usertext
varchar(75) NOT NULL DEFAULT ‘’, qreplyview
int(11) NOT NULL DEFAULT ‘0’, wordmixerstellt
int(7) NOT NULL DEFAULT ‘0’, wordmixgeloest
int(7) NOT NULL DEFAULT ‘0’, wmblock
tinyint(1) NOT NULL DEFAULT ‘0’, adminfield
varchar(250) NOT NULL DEFAULT ‘’, adminfieldname
varchar(250) NOT NULL DEFAULT ‘’, firstvisit
int(10) unsigned NOT NULL, rankingpoints
bigint(20) NOT NULL DEFAULT ‘0’, regip
varchar(15) NOT NULL DEFAULT ‘000.000.000.000’, dev_prof
varchar(30) NOT NULL, useslide
int(11) NOT NULL DEFAULT ‘0’, is_online
int(11) NOT NULL DEFAULT ‘0’, last_ping
text NOT NULL, liga_session
varchar(255) NOT NULL, wikiview
int(11) NOT NULL DEFAULT ‘1’, wikiviewhover
int(11) NOT NULL DEFAULT ‘1’, readrules
int(11) NOT NULL DEFAULT ‘0’, rss_feeds
text NOT NULL, rss_time
int(11) NOT NULL, PRIMARY KEY (userid
), KEY username
(username
), KEY rankid
(rankid
), KEY avatarid
(avatarid
), KEY activation
(activation
), KEY groupcombinationid
(groupcombinationid
), KEY reg_ipaddress
(reg_ipaddress
), KEY rankingpoints
(rankingpoints
), KEY username_2
(username
), KEY birthday
(birthday
), KEY rankgroupid
(rankgroupid
), KEY rankingpoints_2
(rankingpoints
), KEY userposts
(userposts
), KEY birthday_2
(birthday
), KEY username_3
(username
)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=14446 ;
what can I do to improve the query.
Thank you and have a nice weekend.
the_condor