关于Big_Table脚本的一些问题
create table big_table
as
select rownum id, a.*
from all_objects a
where 1=0
/
alter table big_table nologging;
declare
l_cnt number;
l_rows number := &1;
begin
insert /*+ append */
into big_table
select rownum, a.*
from all_objects a
where rownum <= &1;
l_cnt := sql%rowcount;
commit;
while (l_cnt < l_rows)
loop
insert /*+ APPEND */ into big_table
select rownum+l_cnt,
OWNER, OBJECT_NAME, SUBOBJECT_NAME,
OBJECT_ID, DATA_OBJECT_ID,
OBJECT_TYPE, CREATED, LAST_DDL_TIME,
TIMESTAMP, STATUS, TEMPORARY,
GENERATED, SECONDARY
from big_table
where rownum <= l_rows-l_cnt;
l_cnt := l_cnt + sql%rowcount;
commit;
end loop;
end;
/
alter table big_table add constraint
big_table_pk primary key(id)
/
begin
dbms_stats.gather_table_stats
( ownname => user,
tabname => 'BIG_TABLE',
method_opt => 'for all indexed columns',
cascade => TRUE );
end;
/
select count(*) from big_table;
第一个问题:alter table big_table nologging;书上说这个nologging模式提高性能,怎么提高了性能?
第二个问题:这个&1似乎是等待输入一个值,我试试了试,该成&5也行,这个符号&1有没有什么规定;
第三个问题:这个sql%rowcount表示的是不是上次操作涉及的行数?
第四个问题:如果想插入一批数据,为啥非得分成两个部分,先给个参数,插入一批,然后再判断这两个值大小,再插入一批?
第五个问题:书上说先用all_objects的内容填充,然后迭代的插入其自身当中,每次迭代会使表大小几乎加倍?我怎么感觉后边的while循环一次就结束了???
第六个问题:/*+append*/啥意思????
相关推荐
hive_big_table.tar.gz
hive_big_table.tar.gz
BIG5.zip_Table_unicode table
BIG5 to Unicode table
php mysql excel 乱码终极处理
php 开发中遇到的乱码问题处理 读取excel到mysql中的乱码处理。
lagou_big_data_job_table.sql
lagou_big_data_job_table.sql
Synopse Big Table 1.12b
Synopse Big Table is an open source Delphi unit for very fast data storage and access, using key/values pairs, or records organized with fields. With this 1.12a version, the unit has evolved into a true field-oriented database, with two new classes: - TSynBigTableRecord to store an unlimited number of records with fields; - TSynBigTableMetaData to store any data (pictures, HTML, text) associated with metadata fields. Both classes handle variable-length storage of integers, floats, currency, text (Unicode or not) with a field name. On-the-fly field adding, integrated indexing and search capabilities. Data access can be either fast direct access, or via late-binding (i.e. use Record.Field in your Delphi code). Classic Key/Value storage is always possible via TSynBigTable or TSynBigTableString, but is now faster and safer. A few issues were corrected


