Question

reserve space for update

Asked by: playernovis

i have a table which I populate daily (approx 3mm records every day). I need to go back at the end of each month and populate one field, which I don't populate daily at all.

It is a numeric field in range 38000-45000

I want to make the update as fast as possible. I was thinking to populate the field with value 99999 every day, so when I change to to real value, oracle won't allocate new space.....

is 0 going to be the same as 99999 ? (I would rather use 0 than 99999)
if I use CHAR, i can easily reserve the space, is there something like this for numeric?
I can also set PERCENT_FREE, but it is not 100% what I'm looing for....


any better solution than 99999 ??


jiri

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2004-05-13 at 14:54:06ID20988797
Tags

oracle

,

update

Topic

Oracle Database

Participating Experts
4
Points
125
Comments
8

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Oracle Daily Backup..
    Hi: I need to find out the easiest way to setup daily backup process on WindowNT. ideally I would like a schedule process to export the full database, then backup that file every night. What can I do? I am open to any other way/ 3rd party software solution. thank you
  2. Reserve Field in Oracle
    I have a table in which is having a field 'INITIAL' which is reserve word for Oracle, So how i can I create this table in Oracle. 'INITIAL' keyword is not reserved in SQL Server,so my application is working fine with SQL Server. But when I try to create this table in Oracle, ...
  3. Reserving form's space
    How can I make my form reserve its own space so that maximised windows do not obscure it? I don't want to dock my window to the edge of the desktop like a toolbar, just prevent other apps from covering it. Other apps that do this include Hawkeye ShellInit (allows you to defi...
  4. Reserved Words
    What are all of the reserved words (i.e. in, for, temp......) in SQL Server?
  5. shared_pool_reserved_size?
    what is the shared_pool_reserved_size? what is it for? I have the setting like below.. does it look ok? SHARED_POOL_RESERVED_SIZE = 80M SHARED_POOL_SIZE = 600M

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: bvanderveenPosted on 2004-05-13 at 15:03:34ID: 11063824

Just leave as 0 or -1, it will take up the same amount of space.  Typically, updates don't take long because of space allocation.  If that's a problem, create an additional extent before updating.

Numeric fields take up a defined amount of space, depending on their type.

HTH,
Bill Vanderveen

 

by: sbalasuriyaPosted on 2004-05-13 at 18:16:52ID: 11064657

If you are using Oracle 9i, then set "segment space management" to "auto" and relax. Oracle will takecare of update space allocations.

Updating to 99999, you are repeating you work. It makes life harder for the database.

 

by: sbalasuriyaPosted on 2004-05-13 at 18:17:59ID: 11064666

I meant "segment space management" of the tablespace.

 

by: annamalai77Posted on 2004-05-13 at 23:18:53ID: 11065684

hi

as said by our first friend, set ot 0 then have a bigger rollback segment and assign this rollback segment and execute ur update statement.

regards
annamalai

 

by: rajnadimpalliPosted on 2004-05-14 at 02:43:35ID: 11066578

@playernovis :

You are talking about updating very large #of records in millions. You said growth rate is 3 millions records / Day , means you will have 3*30 = 90 millions / month.

Lets say you have already existing data in this table,which hold 6 months of data.Your table size( in #of rows) will 6*90 mill = 540 millions.Now at the end of 7th month you need to update 90 millions records of 7th month data in table which can contain 540+90= 630 millions.
   
So you may be doing some thing like ...Updating one column for 90 million rows out of 630 million rows...

1. It doesn't matter you pre-populate with some dummy # in the column,its not going to help you at all.Your update may run very slow and may never finish also in some case.

2. we have similar kind of Data warehouse table.Initially we took the similar approach of updating the table at the end of month for few columns (because daily loads don't have info for these columns).Initially the update process seems to be ok ( 3hrs to complete) ,but once the table size increased to 0.25 billion rows,it starts taking 11hrs and update never finished on 0.50 billion rows table.Every month end , we need to update three columns for at least 100 million rows.

we re-designed the process ,in a way ,so that we completely avoided the update part.Let me know,if you are interested in details on how we achieved this a simply change table design..

-Raj

 

by: bvanderveenPosted on 2004-05-14 at 06:29:33ID: 11068071

I will second raj - you need some way to do massive updates.  I would suggest looking a bulk binds for this - see this question:

http://www.experts-exchange.com/Databases/Oracle/Product_Info/Q_20978801.html

 

by: playernovisPosted on 2004-05-14 at 09:14:02ID: 11069710

Raj,

If I keep PCTFREE=0 and keep the field with null value, UPDATE will chain the row. It makes the update slower and final queries are slower too.

does PCTFREE = 1 % the same job as pre-populating the field with dummy value? As annamalai mention, pre-populating will create bigger rollback segment.... so PCTFREE is I guess way to go.

yeah, I was thinking about BULK BIND.....


if I twist this discussion, I was even thinking to run INSERT INTO staging table, DROPPING parittion and re-INSERTING data back.....  on 8 processor server, it will take 20 minutes...


jiri

 

by: rajnadimpalliPosted on 2004-05-14 at 17:36:49ID: 11073345

@ playernovis : Sorry for long text....:)..

Yes!. I agree if the PCTFREE=0 and update a null column to value will chain the rows,which will effect the update performance , which is kind of theoretical talk.But I am talking about , despite you pre-populate and/or have enough PCTFREE , in your case ,it doesn't really help much ,because bottom-line your update may not finish or may take long time , if your table grows very large in billions.Let me share quick summary of some figures and method we tried in our shop.

HP-9000 with HP-UX11.00 : 16 cpus with 32GB ram dedicate server with Oracle 8.1.7.4  total database size ~ 3TB.
Storage system : EMC frame

- Table contain 63 columns holds ~900 million rows and size in bytes ~82 GB non-partition table
- daily load will populate 3-4 millions rows only populated 60 columns and 3  columns will not have info while doing daily loads
- 3 columns information for each row will be available after 45days from the date of new row load.
- Business requirement once the 3 columns information is provided by business,it should be available for users with-in 30 days.
- so we do update every 30 days /end of month  all rows which we have info on these 3 column.


Method 1: - with Pre-populate the column (actually in my case , by default value in these 3 columns will be defaulted due to column default value defined in table definition ).So the idea of pre-populate to help avoid any chaining we already taken care.Note : All values in 3 columns are numeric.

- One of 3 columns have bitmap index
- single update statement ( 80-120 million rows) with cursor resultset - rollback generate : 12 GB ; redo Generate : 6GB ( noarchivelog database) ; Drop bitmap index , update , create bitmap index
- ~9 hours to complete
- Update  ( select a.col1,b.col1..... from a,b where a.col10.. ... ) set a.col1 = b.col2

Method 2 : Bulk Binding Update

- PL/SQL Bulk Binding : with LIMIT rows : 1500 rows to 1 million ( due to free memory limit on server )
- Drop bitmap index , execute pl/sql bulk update . Little
- ~ 7 hours ( Super its much better , but its not sufficient )

Method 3 : Parallel Direct Update

- Parallel Direct Update not possible in my case because the table in non-partition table
- may be will be help you ,if you table is partition table.
- I think its will give you better response time compared to Method 2

Method 4 : Don't Update  , do CTAS or Insert select  : This you already know Possible in most situations...

- we did tested on Full blow with CTAS and Insert select , created all 11 bitmap indexes
- with 14 parallel slaves : CTAS/insert select : finished with in ~ 9 minutes....Yes!. 9 minutes.
- But 11 bitmap indexes creation took : ~ 2hours including analyzing the table and indexes
- Over-all time : ~ 2 hrs to 2.5 hours ( Great )

Method 5 :  Don't Update Nor Don't Do CTAS /Insert Select , But ... "Tune the Question Before Tuning the SQL "

- Business requirement in this case ,is 3 columns information need to be provided for users for select purpose.They ( users) never update nor delete information in this table.
- So here we did which is completely transparent to Users..
- Maintain a separate table which holds information on these 3 columns with the Primary key : this is very small in size (bytes) and hold more or less same # of rows.
- create a view Joining this separate table with original table on primary ,which get information on 3 column from small table.
- give access on this view for users.Query performance against view when compared to base is all most same ,which users can notice.
- Big advantage is the information on three column is available right-away. Its LIVE information as soon as the separate table is loaded with new information.

More details on how-to :

- Table Name : ACCOUNT_ORIGINAL with 63 columns ( Primary key : COL1+COl2 ) : Large table same as Method 1,where daily loads populate the column COL1 to COL60.
                 
- Create new table : ACCOUNT_ADDITIONAL with columns ( primary key :COL1+COL2)  and columns COL61,62,63  : This will simply hold more or less same rows ,but every small in size ( ~ 600 MB in my case)

- Create a view : ACCOUNT with 63 columns joining ACCOUNT_ORIGINAL and ACCOUNT_ADDITIONAL by Primary key.

Create or replace view ACCOUNT
as
select
a.col1,a.col2,...................,
b.col61,
b.col62,
b.col63
from
ACCOUNT_ORIGINAL A,
ACCOUNT_ADDITIONAL B
where
a.col1 = b.col2(+)
and
a.col2 = b.col2(+)
/

- Users will use the view ACCOUNT instead of table,so that they will get live-information for all columns including COL63.The performance of the view will be same as quering the base table and users loved it and business is happy and IT is happy ( Cut 8% over-all resource utilization on the server due to no update/ctas  ).

Good Luck ,

-Raj

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...