Sub-optimal predicate checking while selecting from a view
----------------------------------------------------------

                 Key: CORE-3981
                 URL: http://tracker.firebirdsql.org/browse/CORE-3981
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 2.5.2, 2.5.1, 2.5.0
            Reporter: Dmitry Yemanov


Test case:

(1) Select from a derived table

select * from (
select r.rdb$relation_name, abs(r.rdb$relation_id) as id
from rdb$relations r natural left join rdb$relation_fields rf
where rdb$relation_id < 128
)
where id = 0

-- 42 reads from RDB$RELATIONS / 4 reads from RDB$RELATION_FIELDS

(2) Select from a view

recreate view v
as
select r.rdb$relation_name, abs(r.rdb$relation_id) as id
from rdb$relations r natural left join rdb$relation_fields rf
where rdb$relation_id < 128;

select * from vvv
where id = 0

-- 42 reads from RDB$RELATIONS / 343 (!) reads from RDB$RELATION_FIELDS


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to