The fastest way to delete the rows is with a load. If you know what
you will be inserting (in bulk), then load with that. Otherwise load
with an empty input file. This will work for all UDB.
I'm assuming that with that many rows it is a single table tablespace.
zOS Segmented Tablespac tables have special procssing for DELETE *
(resetting the page in use bits by segment), but you should issue a
LOCK TABLE first.
Remember, DELETE is a logged operation (unless you are on LUW and the
tablespace has a NOT LOGGED INITIALLY enabled and active) and logging
will be the slowest portion of the process (excluding indexes).
R > > Hi ,
R > >
R > > I have a table that contains 15lakh records.....
R > > I want delete that table....and insert fresh set of record.
R > >
R > > when I run the command ...db2 "delete from schema.tabname"
R > > it hangs .......the system it seems hangs...
R > >
R > > Is their a better way out to delete the data..
R > >
R > If you're on OS/390 or z/OS you should consider doing a drop of the
R > tablespace containing the table; I believe that this deletes the rows almost
R > instantly if the tablespace is of the "segmented" type.
R > However, be sure to verify this with a test database first; I know this was
R > possible in some of the earlier versions like Version 3 but I'm not
R > absolutely positive that it still works that way.
R > Of course, if you drop a segmented tablespace, you will drop _all_ of the
R > tables in the tablespace, not just the one you want to delete, so it would
R > be best if you redesigned your schema to put this large table in a segmented
R > tablespace of its own. You will also want to consider the impact on any
R > tables related to your table via referential integrity if you drop the table
R > (by dropping the tablespace) rather than deleting the rows.
R > Rhino
Edward Lipson via Relaynet.org Moondog
ed***********@moondog.com el*****@bankofny.com
---
þ MM 1.1 #0361 þ
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---