On 18 Jan 2003 at 19:56, Binand Raj S. wrote:
> SELECT a.name,b.filename FROM owners a, files b WHERE a.uid = b.uid
> ORDER BY b.size DESC LIMIT 10;
Well, query performance depends upon size of table you are querying upon and
how updated the statistics is.
If you put the query on biggest table in a subselect, chances are that planner
will use appropriate indexes on that table. Besides planning for joins, getting
tabe order and indexes straight is a tough job. A subselect could improve
things a bit.
> I have an intuitive feeling that this is not probably the best way
> to do this. In that case, what are the alternatives? How do I measure
> their performances?
vacuum analyze; explain select ..
That is the closest you can get without running the query..
"There's only one kind of woman ..." "Or man, for that matter. You either
believe in yourself or you don't." -- Kirk and Harry Mudd, "Mudd's Women",