>> A big con for Load that we ran into was:
>> - load would leave the tablespace in 'backup pending' mode, thus requiring
[quoted text clipped - 3 lines]
> You need to use COPY YES in order to perform a recoverable load and
> avoid placing the tablespace into backup pending state.
Yeah, i try very hard to avoid using load on a transactional database.
In the case of my warehouse, it is non-transactional - and the load
files are the backups: if a recovery is required we move the compressed
files from archive to input, and the loader takes care of it.
Simplifies most things.
> - load also needed to acquire a
>> - load also needed to acquire a super exclusive lock on the table
> Yes, but if you are doing an online load, the Z-lock on the table is
> only held for a short time.
yeah, i've only really had problems with load allowing read access when
the server was getting hit by a massive barrage of like 60,000 queries
- to drive canned reports. Other than that, a long lockwaittime of 120
seconds or so (assuming average query duration of 5 seconds) has worked
fine.
One other thing I forgot to mention: the insert_update import option
is really handy, and i'm often now using it for smaller volume (<
100,000 row) table ETL operations. Especially when concurrency is
tricky.
Ian - 27 Oct 2005 06:43 GMT
> One other thing I forgot to mention: the insert_update import option
> is really handy, and i'm often now using it for smaller volume (<
> 100,000 row) table ETL operations. Especially when concurrency is
> tricky.
Obviously you've been around the block a few times, but from a
concurrency perspective, you do realize that IMPORT (by default)
takes an exclusive lock on the table it is writing to, right?
This was a MAJOR concurrency issue; I had to write a replacement
for the import utility to avoid this in V7.2.
One of the V8 fixpacks (finally!) allowed you to work around this
requirement, and FP9 added the 'ALLOW WRITE ACCESS' option to IMPORT.
usenet@kikobu.com - 27 Oct 2005 12:15 GMT
"... IMPORT (by default)
takes an exclusive lock on the table it is writing to" - if I do an
IMPORT with REPLACE option, and someone tries to SELECT from the table
while I'm importing, their SELECT will wait until..? Next commit from
the IMPORT or until the job is done?
Thanks.
Morten
kenfar - 27 Oct 2005 15:24 GMT
> "... IMPORT (by default)
> takes an exclusive lock on the table it is writing to" - if I do an
> IMPORT with REPLACE option, and someone tries to SELECT from the table
> while I'm importing, their SELECT will wait until..? Next commit from
> the IMPORT or until the job is done?
Not positive on this one - but I don't think this will work for you: I
assume that the data previously in the table is completely wiped out by
the time of the first commit. So, you would likely want to have this
operation be all or nothing via load or by only commiting once.
An alternative in this scenario might be the insert_update option -
which will only create row locks if you use allow write access (thanks
Ian for the reminder). Of course, that won't delete data.
ken
usenet@kikobu.com - 27 Oct 2005 16:26 GMT
Thanks for the input. If the REPLACE option is used, IMPORT will
truncate the table when it starts (as far as I can read the docs). The
question is now, whether IMPORT locks the table during the entire
process, or it allows pending read processes to run in between commits.
I need to delete the existing data (thus the REPLACE option), so I'm
afraid an "all or nothing" scenario is very hard to make using
LOAD/IMPORT.
usenet@kikobu.com - 27 Oct 2005 17:31 GMT
Welp.. Import does not allow me to read in between commits. But it
suprises me that it is so extremely slow. I have written a client in
Java which using JDBC is very much faster (20-50 times) and that really
surprises me. The Java client uses batching (100 inserts sent over the
wire at a time, then commit) and stored procedures, the IMPORT job
commits after each 500 rows. I guess the IMPORT job sends one insert at
the time across the wire.
Ian - 28 Oct 2005 20:25 GMT
> Welp.. Import does not allow me to read in between commits. But it
> suprises me that it is so extremely slow. I have written a client in
[quoted text clipped - 3 lines]
> commits after each 500 rows. I guess the IMPORT job sends one insert at
> the time across the wire.
Yes, by default IMPORT does 1 row per insert statement. You can say,
import ... of del MODIFIED BY COMPOUND=x ...
(I think 0 < x <= 100)
This allows multiple rows to be written in each INSERT statement and can
often result in better performance.