Solved

Query question

Posted on 2007-04-03
4
787 Views
Last Modified: 2012-06-27
I have a query like below..
Insert /*+ append */ into sales select * from  temp_sales.

What is /*+ Append */ ? when do you use it?   is it some kind of index hint?
0
Comment
Question by:jung1975
  • 2
4 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18846136
/*+ APPEND */ is an oracle hint, that tells oracle to add the data above the high water mark, and does not try to find empty space in the already used blocks of the table.
0
 
LVL 142

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 150 total points
ID: 18846149
when to use it: usually, when you load lots of rows to the table, ie from another table.
using it will avoid the overhead of trying to fit in few rows each time into places in blocks where rows have been deleted previously in the table.
will not give any performance boost on tables that are empty, or where all blocks are full.
0
 
LVL 16

Assisted Solution

by:MohanKNair
MohanKNair earned 50 total points
ID: 18846451
Append hint can be used to bypass UNDO operations while doing insert
0
 
LVL 28

Accepted Solution

by:
Naveen Kumar earned 300 total points
ID: 18846476
just to put it with some sample data:

table1
-------
row1             - existing
row2             - deleted
row3             - deleted ( though row2 and row3 are deleted from table, this space can be reused for inserts but this is an used space )
row4             - existing. This is the last row in the table till now.  So any space beyond this is unused space from here till the allocated space of the object.

if you use this hint /*+ append */, the insert command will start from the unused space after row4 and it will continue...meaning if not sufficient it will consume space from the tablespace.

If this hint is not used, then oracle might try to use the free space ( already used space of row 2 and row 3 ) for the new inserts which we are doing and if the record length of the data which we are inserting is matching with the free space ( already used space of row2 and row3 ).

let us say, deleted records had many fields had null and new inserts have data for all fields and so oracle will just try and free space ( used space ) will not be sufficient and so it proceeds after row4 which is like using /*+ append */ hint.

As angelIII said, for tables which are complete empty ( meaning tables which are already truncated or just got created ) or tables which are completely full ( with no holes in the data blocks ) will not have any impact whether u use this hint or not.

Thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now