Subject | Re: [firebird-support] Optimizer request |
---|---|
Author | Svein Erling Tysvær |
Post date | 2016-09-09T15:10:14Z |
Never use IN (subselect). Change to
select * from orders where exists( select * from partners where partners.partid = orders.partid and partners.country = ‘Spain’)
2016-09-09 14:30 GMT+02:00 'Djordje Radovanovic' softsistem@... [firebird-support] <firebird-support@yahoogroups.com>:
I tried query with subquery in where clause and found big issue for this type of subquery.for example:select * from orders where orders.partid in (select partners.partid from partners where partners.country = ‘Spain’)Perfomance Analysis returns me thispartners 687660 non index readsorders 28657 index readsIf you analyze this result you’ll find that there is 687659 unnecessary non index reads. If developer of optimizer accept that all queries on the left side of where clouse has priority (and there is no way to be opposite) than we have big improvement in optimization.Best regards,Djordje Radovanovic