Code: Select all
SELECT * FROM f_posts WHERE author='$name' ORDER BY postid DESC LIMIT $x, $yThe author and postid columns have both been indexed. postid is the primary key.
The table currently has about 12,400 rows.
$x and $y change depending on the page number (each page shows 15 results).
If I run an EXPLAIN on the first full query, it goes:
id: 1
select_type: SIMPLE
table: f_posts
type: index
possible_keys: author
key: PRIMARY
key_len: 4
ref: NULL
rows : 96
Extra: Using where
What could be causing the problem, and how do I fix this? Thanks!