Subject Re: [firebird-support] how to do a view (or work with) of top 80000 records
Author Gary Benade
> Alex wrote
> He will probably find out himself... Combining COUNT, GROUP BY with a join
> and a subselect is perhaps a bad idea :-)

In my experience firebird handles this kind of work extremely well,
especially when provided with the right indexes. The issue with the sub
select only surfaces when you do this

select * from customers a
where a.weighted_value > (select weighted_value from customers where link =
a.link)

this forces firebird to run the subselect for every row because the
subselect references the left table.

select * from customers a
where a.weighted_value > (select weighted_value from customers where
weighted_value < 10)

allows firebird to resolve the subselect once and apply it as a fixed
value - it would be illogical to run the subselect for every row.

The results, as per my previous post, do speak for themselves.

Regards
Gary