RE: Index not used with GROUP BY? (bug?)

2001-11-16 Thread Keith C. Ivey
On 15 Nov 2001, at 22:32, Carsten H. Pedersen wrote: Thanks for the response, but I think you missed the key collection_field_value right under the primary key above. You're right -- Sorry. Have you tried COUNT'ing something other than *? i.e. document_id or resource_id? I tried it.

RE: Index not used with GROUP BY?

2001-11-15 Thread Carsten H. Pedersen
I'm trying to keep a table of summary statistics for another table, because I expected that generating the counts would take a while. But I never expected the query to take hours, as it does. On examination, I see that the query is not using an index, even though the table has an index on

RE: Index not used with GROUP BY?

2001-11-15 Thread Keith C. Ivey
On 15 Nov 2001, at 21:59, Carsten H. Pedersen wrote: PRIMARY KEY (`collection_id`,`document_id`,`tcml_field_id`,`order_number`), KEY `collection_field_value` (`collection_id`,`tcml_field_id`,`value`(12)), KEY `value` (`value`(12)), KEY `resource_id` (`resource_id`) )

RE: Index not used with GROUP BY?

2001-11-15 Thread Carsten H. Pedersen
On 15 Nov 2001, at 21:59, Carsten H. Pedersen wrote: PRIMARY KEY (`collection_id`,`document_id`,`tcml_field_id`,`order_number`), KEY `collection_field_value` (`collection_id`,`tcml_field_id`,`value`(12)), KEY `value` (`value`(12)), KEY `resource_id` (`resource_id`)