db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tomi N/A" <hef...@gmail.com>
Subject Re: performance, memory consumption...and a big hello :)
Date Mon, 10 Aug 2009 20:08:59 GMT
2009/7/29 Dan Armbrust <daniel.armbrust.list@gmail.com>:
>> Problem 1:
>> select id_group, count(id)
>> group by id_group
>> This takes a couple of minutes,
> Is that the entire query?  No where clause?
> I don't think any database is going to use the index when you aren't
> providing a where clause... especially when you have a count and a
> group by in there... it has to read the entire table.

Well, initially, I would have agreed with you, but after having
thought about it for a while and having read a couple of threads in
various forums and mailing lists, I think it's not impossible: an
index might in fact be useful if all the information is inside it,
i.e. the table itself doesn't need to be read. Still, you might be
right: I'm not sure yet.

View raw message