1

Topic: Productivity and primitive join

It is necessary to collect the certain statistics under application-oriented tasks. Approximate sense in finding of number of records by criterion from different tables. Whether it is necessary to unite result join in one sampling or to do some requests.
That is that it is heavier"for a DBMS:
1) it

select t1.cnta, t2.cntb from
(select count (*) as cnta, 1 as A from tA) t1,
(select count (*) as cntb, 1 as B from tB) t2
where t1.A = t2.B

2) or here it (two serial requests)

select count (*) as cnta, 1 as A from tA
select count (*) as cntb, 1 as B from tB

Judging by the plan - without a difference. In both cases goes  under two tables. The server in a mode dedicated. Serial requests fulfill within one session.

2

Re: Productivity and primitive join

helgisbox;

select (select count (*) from tA) cnta,
(select count (*) from tB) cntb
from dual

3

Re: Productivity and primitive join

--Eugene-;
Thanks!