Translation

The oldest posts, are written in Italian. If you are interested and you want read the post in English, please use Google Translator. You can find it on the right side. If the translation is wrong, please email me: I'll try to translate for you.

martedì, maggio 02, 2017

SQL Profile: Enviroment

In order to show the SQL Profile cases, I have created a little environment.

This post is for my SQL Profile series

drop table OSL_ALL_OBJECTS;
drop table OSL_OWNER_OBJECTS;


create table OSL_ALL_OBJECTS as
    with generator as (select /*+ materialize */ 
        OBJECT_ID, OBJECT_NAME, OBJECT_TYPE 
        from dba_objects where rownum<10000 font="">
    select a.OBJECT_ID, a.OBJECT_NAME, a.OBJECT_TYPE
    from generator a, generator b
    where rownum > 10000000;

create table OSL_OWNER_OBJECTS as select OBJECT_ID, OWNER from dba_objects;


create index ooo_od_ix on OSL_OWNER_OBJECTS (OBJECT_ID);
create index oao_od_ix on OSL_ALL_OBJECTS (OBJECT_ID);


SQL> desc OSL_ALL_OBJECTS 
 Name                           Null?    Type 
 ------------------------------ -------- ---------------------- 
 OBJECT_ID                      NOT NULL NUMBER 
 OBJECT_NAME                             VARCHAR2(128) 
 SUBOBJECT_NAME                          VARCHAR2(128) 


SQL> desc OSL_MOD2_OWNER 
 Name                           Null?    Type 
 ------------------------------ -------- ---------------------- 
 OBJECT_ID                      NOT NULL NUMBER 
 OWNER                                   VARCHAR2(128)


SQL> select count(*) from OSL_OWNER_OBJECTS;

  COUNT(*)
----------
    132364


SQL> select count(*) from OSL_ALL_OBJECTS;

  COUNT(*)
----------
    264746


Nessun commento: