At 11:55 AM 10/15/2006, you wrote:
On 10/15/06, Freebat Wangh <[EMAIL PROTECTED]> wrote:
mysql> explain select lw.id, lw.sender as guest_id from gossip lw where
lw.owner = 21821 order by lw.id desc limit 18540, 20\G;
*** 1. row ***
id:
On 10/15/06, Freebat Wangh <[EMAIL PROTECTED]> wrote:
mysql> explain select lw.id, lw.sender as guest_id from gossip lw where
lw.owner = 21821 order by lw.id desc limit 18540, 20\G;
*** 1. row ***
id: 1
select_type: SIMPLE
t
On 10/15/06, freebat <[EMAIL PROTECTED]> wrote:
This approach will make the query filesort.
why?
You use the index owner_id to filter the rows and the primary key index to
perform the sort!
or not?
test it with explain:
explain select lw.id , lw.sender as guest_id from gossip lw where
lw
This approach will make the query filesort.
Shen139 wrote:
I don't understand why you are using an index like `owner_id` composed
by `owner` and `id`!
I think that you should change it removing `id` from the fields list:
...
PRIMARY KEY (`id`),
KEY `owner_id` (`owner`)
...
On 10/15/06
I don't understand why you are using an index like `owner_id` composed by
`owner` and `id`!
I think that you should change it removing `id` from the fields list:
...
PRIMARY KEY (`id`),
KEY `owner_id` (`owner`)
...
On 10/15/06, freebat <[EMAIL PROTECTED]> wrote:
this is the table:
CREATE TA
this is the table:
CREATE TABLE `gossip` (
`id` bigint(20) unsigned NOT NULL auto_increment,
`owner` int(11) NOT NULL,
`sender` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `owner_id` (`owner`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
table status:
mysql> show table st