473,725 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

LOAD vs. IMPORT


Hi.

Can any of you explain the major differences in LOAD and IMPORT in
laymen terms?

I've read the DB2 docs: "[IMPORT] Inserts data from an external file
with a supported file format into a table, hierarchy, or view. A faster
alternative is LOAD; however, the load utility does not support loading
data at the hierarchy level."

What does "loading data at the hierarchy level" imply? I have 5 tables,
no (enforced) referential constraints. The biggest table has 500.000
rows and if possible I would like to avoid locking the table for long
(rather return an empty result set that have user wait).

Given my situation, what are the pros and cons of the two?

Thanks.

Morten

Nov 12 '05
13 17852
us****@kikobu.c om wrote:
"... 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

Nov 12 '05 #11
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.

Nov 12 '05 #12
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.

Nov 12 '05 #13
Ian
us****@kikobu.c om wrote:
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.


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.
Nov 12 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3398
by: davvid | last post by:
hello, please I would like to know if it's possible to load data in hierarchical table structure with identity column used as pk (for all the tables) : I mean table root (Id_root(pk,identity column generated always), att_r1,...) table leaf (Id_leaf(pk,identity column generated always), id_root(fk ref root), att_l1 ...)
2
5812
by: jay | last post by:
hi, Question on Load/import command. consider a sample table create table table_name ( col1 timestamp not null default current timestamp, col2 int, col3 int, col4 int, primary key(col1) ); There is a file file.del containing data for col2,col3,col4. Data for
2
1679
by: Ravi | last post by:
Hi friends, I have to lode/import the data from files, is there any command to lode/import, in same time ( with singal command) iam using db2 8.2. Thanks In advance, Ravi.
7
3710
by: Eric | last post by:
Hi, Any suggestion to Rapid Application Dev with postgreSQL ? I have a small app to make. I would prefer open-source solution if possible. I also would like to developp on my linux box but the result will be used on a windows 2000 and XP machine. But If I have no choice, I will developp on winXP.
1
1663
by: aj | last post by:
DB2 WSE LUW 8.1.5 A few questions: Why doesn't IMPORT have IDENTITYOVERRIDE support like LOAD does?? Why doesn't LOAD have CREATE INTO (ala IXF) like IMPORT DOES? Why doesn't: db2 -tvf blah.sql 2> blah.err
6
3091
by: Hemant Shah | last post by:
Folks, Today, I was exporting a table in one database and then importing it in another database. The table in destination database was missing one column (my mistake while creating the table), but import did not complain about it. Source table: Column Type Type
1
1872
by: jrickard | last post by:
Hi, I'm getting an SQL3193N on DB2 v8 (fixpak 11)... SQL3193N The specified view or materialized query table cannot be updated. You cannot LOAD/IMPORT into this view or LOAD into this materialized query table. ....when I try to IMPORT INSERT into my non-updateable view. The view has an INSTEAD OF trigger defined on it, and inserts with standard SQL
1
3731
by: sai1001 | last post by:
hi, I am trying to load the data from flat file to temp table in different ways. import from 'c:\OCT SC REPORT TAKE 2.csv' into session.kfs_file; load from 'c:\OCT SC REPORT TAKE 2.csv' of ASC insert into session.kfs_file; But i am getting the error like this. SQL1325N The remote database environment does not support the command or one of the command options.
0
1984
by: rradhak | last post by:
Hi, We use udb version 8.1 fixpack 11 under AIX 5.3 Is there a way to use load/import against temporary tables? DB2 does not recognize session tables. Is there any workaround?
0
8889
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3228
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.