How to make insert faster without droping indexs???????
here is some challenge
I do not any option to drop index or stop nologgin etc. etc..
the only thing I can do it change my DML..
its' 10g
JUST FYI: with index, my insert would take less than 1 second.
AND my question is regarding this statement
--CREATE INDEX h_item_name ON h_item(name) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS('storage vzw_item_1_storage sync (every "SYSDATE+15/1440" )');
insert into h_item
select * from s_item;
set timing on
drop table s_item;
create table s_item
(name varchar2(2000 byte));
drop table h_item;
create table h_item
(name varchar2(2000 byte));
declare
begin
for i in 1..100000
loop
insert into s_item values(i||'SOME JUNKS');
end loop;
commit;
end;
CREATE INDEX h_item_name ON h_item
(name)
INDEXTYPE IS CTXSYS.CONTEXT
PARAMETERS('storage vzw_item_1_storage sync (every "SYSDATE+15/1440" )'
insert into h_item
select * from s_item;
rollback;
Table dropped.
Elapsed: 00:00:01:01
Table created.
Elapsed: 00:00:01:28
Table dropped.
Elapsed: 00:00:00:29
Table created.
Elapsed: 00:00:00:26
PL/SQL procedure successfully completed.
Elapsed: 00:00:06:73
Index created.
Elapsed: 00:00:00:45
100000 rows created.
Elapsed: 00:00:13:01
Rollback complete.
Elapsed: 00:00:03:07
it's not new table... so can not use create table as.....
set array did not also help...
here is log still took 12 seconds
SQL> insert into h_item
2 select * from s_item;
100000 rows created.
Elapsed: 00:00:12.07
SQL>
SQL> rollback;
SQL> show array
arraysize 15
SQL> set arraysize 5000
SQL> set echo on
SQL> @tr1
SP2-0310: unable to open file "tr1.sql"
SQL> @t1
SQL>
SQL> set timing on
SQL>
SQL> drop table s_item;
Table dropped.
Elapsed: 00:00:00.11
SQL> create table s_item
2 (name varchar2(2000 byte));
Table created.
Elapsed: 00:00:00.01
SQL>
SQL> drop table h_item;
Table dropped.
Elapsed: 00:00:00.59
SQL> create table h_item
2 (name varchar2(2000 byte))
3 NOLOGGING;
Table created.
Elapsed: 00:00:00.01
SQL>
SQL> declare
2 begin
3 for i in 1..100000
4 loop
5 insert into s_item values(i||'SOME JUNKS');
6
7 end loop;
8 commit;
9 end;
10 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:05.34
SQL>
SQL>
SQL>
SQL> CREATE INDEX h_item_name ON h_item
2 (name)
3 INDEXTYPE IS CTXSYS.CONTEXT
4 PARAMETERS('storage vzw_item_1_storage sync (every "SYSDATE+15/1440" )'
5 )
6 ;
Index created.
Elapsed: 00:00:00.20
SQL>
SQL> insert into h_item
2 select * from s_item;
100000 rows created.
Elapsed: 00:00:12.07
SQL>
SQL> rollback;
Rollback complete.
Elapsed: 00:00:01.85
SQL>
SQL>
Similar Messages
-
How to make system faster without oc?
my system spec
AMD 1.9gig +
MSI KT3 ULTRA
512mb pc2100 ddr
primary 30gig quantum 7200rpm AS
slave 60gig seagate 7200rpm
asus V7100 64mb magic
sony cdrw 120s + adaptec scsi 2490
sony dvd 16x
panasonic cdrom ( for burning purpose )
bios V5.4 + windows 2000 sp2
It seem that this comp is slow, for example it boots much longer than my amd 1.4 thunderbird
when i do regedit it take so long to browse thru the list
is there ne way to get this guy faster without oc. since i dont know much about oc and not confident in attempting itUse the high performance defaults if you don't want to oc and increase the FSB.
:D :D :D -
How to make insert faster?
Hi,
11.1.0.7.3 on Linux Redhat 5 64bit. My database does an average 150 transaction per second 10am to 4pm. Most of them are insert into two partitioned tables 1 row at a time. The tables have only essential indexes with no FK. The disk array is 1+0, not many disks though. SAS disk, if I'm not wrong. I asked for SSD but didn't happen.
Main fg events are CPU 80% and commit (log file sync) 19%. Main bg event is "log file parallel write" 86%. Obviously the rate of redo flushes to disk is very high and disk is having problem keeping up.
How can I improve the situation?AliD wrote:
Hi Hemant,
Actually CPU usage is not very high.. It's a high percentage of DB time, not system usage.
Begin Snap: 2849 30-Nov-10 10:00:35
End Snap: 2855 30-Nov-10 16:00:46
Elapsed: 360.18 (mins)
DB Time: 47.46 (mins)
Event Waits Time(s) Avg wait (ms) % DB time
log file sync 3,419,446 555 0 19.48
Event Waits Total Wait Time (s) % bg time
log file parallel write 3,422,047 542 86.25I might look paranoid, but at this point the application is running at 10% provisioned capacity and numbers are looking good. I want to prepare it for when more customers kick in.Well, you need to get a realistic load to find out what will happen. There are so many variables, and application usage patterns are where the issues will arise. Remember, multiversion concurrency effects are where you will find contention that will make things go downhill fast, whether they are memory latch chains or undo I/O thrashing. Advisors can only deal with one variable, and not necessarily well at that.
Assuming your app is perfect, of course.
http://method-r.com/downloads/doc_details/44-thinking-clearly-about-performance helps, there is no substitute for accurate testing. -
How do you make audio fast without changing pitch?
How do you make audio fast without changing pitch?
PrPro may have that but I've always just gone over to Audition ... you change speed there, you're given a choice of keeping the pitch the same or allow it to change. Note ... if there's much cha ge in speed the result can be odd.
Neil -
Hi,
I have a table with huge volume of data. I am doing following activity using SQL script
1). alter table my_tab add new_col NUMBER(10);
2). update my_tab set new_col= 50;
3). alter table my_TAB modify new_col NOT NULL;
4). Create index on my_tab(new_col);
Above scrip is taking around 10 hours to excecute.
Could any one please suggest how to make it fast.
Thanks.amit_hum wrote:
Hi,
I have a table with huge volume of data. I am doing following activity using SQL script
1). alter table my_tab add new_col NUMBER(10);
2). update my_tab set new_col= 50;
3). alter table my_TAB modify new_col NOT NULL;
4). Create index on my_tab(new_col);
Above scrip is taking around 10 hours to excecute.
Could any one please suggest how to make it fast.
Thanks.You haven't told us your database version.
You haven't shown us the details of your table structure or an example of the data, or even how many rows is a "huge volume of data".
Without proper information we would just be guessing and that doesn't help anybody. -
How to DELETE millions of records. How to make it fast.
Hi
I need to delete near abt 134 millions of records from tables.
How to make it faster? any trick , any settings.
I am using Oracle 9i on Linux box.
If suppose i use TRUNCATE . does it deletes all objects defined over tables like constraint, indexes etc.
Thanks,
Kuldeephi
SQL> create table te as select * from all_objects;
Table created.
SQL> create index te_ind on te ( owner);
Index created.
SQL> truncate table te;
Table truncated.
SQL> select index_name , status from user_indexes where table_name = 'TE';
INDEX_NAME STATUS
TE_IND VALID
SQL> create table ti as select * from all_objects;
Table created.
SQL> create index ti_ind on ti ( owner);
Index created.
SQL> drop table ti;
Table dropped.
SQL> select index_name , status from user_indexes where table_name = 'TI';
no rows selected
SQL>regards
Taj -
Slow Phone 4s with ios8!! How to make it faster?
Slow Phone 4s with ios8!! How to make it faster? After upgraded ios8.1.1, my iPhone 4s Facebook become very slow response and always hand. Whastapp having same problem! Very lagging with safari too! It is really regret to upgrade since many peoples say upgrade will have this issue always
Slow Phone 4s with ios8!! How to make it faster? After upgraded ios8.1.1, my iPhone 4s Facebook become very slow response and always hand. Whastapp having same problem! Very lagging with safari too! It is really regret to upgrade since many peoples say upgrade will have this issue always
-
How to make a redirect without auto-redirect from the portlet "edit" mode?
How to make a redirect without auto-redirect from the portlet "edit" mode?
I use some sofisticated customizing with server-side validation of the form data. I want to redirect to the page of the portlet "show" mode and to the "edit" mode depending on the validation results. How can I do it?Heay.....this worked for me.
I am able to change the mode programatically from edit to show.
HttpPortletRendererUtil.handleEditAction(portletRenderRequest,"OK");
I removed Apply , OK and Cancel buttons and applied my own Submit and Back button in Personalize mode and then change the mode to show on click of Back button using the above mentioned statement.
Thanks
~Neeraj Sidhaye
Try_Catch_Finally @ Y !
ExtremePortal @ Gmail Dot Com -
How to make things fly without a greenscreen in Motion 5
How to make things fly without a greenscreen in Motion 5
green-screen = color-key is just one method to 'punch out' the wanted parts of a pic from the unwanted.
other methods:
• luma-key: object is in front of a plain black (or white) background ...
• alpha-key: 'object' is a computer-generated image, rendered with an alpha-key
• rotoscoping: you mask the the object by hand from the unwanted parts.
...and 'fly' is just key-framing the scenery so it looks like the object is hovering over all .........
very unspecific question, hm? -
How to make dataload fast into a table having CONTEXT index on CLOB column?
Hi all,
I have a table with the follwing structure :
CREATE TABLE file_table (
file_id NUMBER(10) PRIMARY KEY,
file_name VARCHAR2(3000),
file_data CLOB);I am loading around 50,000 files into the table using SQL*LOADER.
LOAD DATA
INFILE * BADFILE 'd:\mydata.bad' DISCARDFILE 'd:\mydata.dis'
INTO TABLE file_table
APPEND
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
file_name CHAR(1000),
file_data LOBFILE (file_name) TERMINATED BY EOF
BEGINDATA
D:\TEXT\9701.1\00\00\01.txt
D:\TEXT\9701.1\01\01\03.txt
D:\TEXT\9701.2\02\02\04.txt
D:\TEXT\9701.3\03\03\05.txt
..after this I am creating Text index :
CREATE INDEX file_table_idx ON file_table (file_data)
INDEXTYPE IS CTXSYS.CONTEXT online
PARAMETERS('filter ctxsys.null_filter LEXER mylex NOPOPULATE')
PARALLEL 2; Here my problem is:
For the first time without creating index when I am trying to load 50000 files through SQL*LOADER conventional loading it is loading in 1 min 38 seconds.
After that for creating index around : 11 min 12 seconds.
But if I am loading another set of 10000 files after creating index, SQL*LOADER is taking considerable amount of time.
For example :
Index created with SYNC(ON COMMIT) : 28 min 45 sec
Index created with SYNC(MANUAL) : 8 min 34 sec
Index created with NOPOPULATE : 2 min 36 sec + 8 min 47 sec to rebuild the index.
Please suggest me the best approach so that further load of files to the table also should take comparatively same time as the first load of 50000 files.
Please suggest me how to create index to reduce load time.Hi all,
I tried to load files using the below procedure also:
CREATE OR REPLACE PROCEDURE load_file_to_my_docs (p_file_name IN my_files.name%TYPE) AS
v_bfile BFILE;
v_clob CLOB;
BEGIN
INSERT INTO my_files (id, name, doc)
VALUES (my_files_seq.NEXTVAL, p_file_name, empty_clob())
RETURN doc INTO v_clob;
v_bfile := BFILENAME('SAMPLEDATA', p_file_name);
Dbms_Lob.Fileopen(v_bfile, Dbms_Lob.File_Readonly);
Dbms_Lob.Loadfromfile(v_clob, v_bfile, Dbms_Lob.Getlength(v_bfile));
Dbms_Lob.Fileclose(v_bfile);
COMMIT;
END;
But I found SQL*LOADER is loading fast compartive to this procedure.
So please suggest me to reduce the time taking to load data once after creating TEXT index. -
I have a small query
select * from x order by b asc
its very slow how can i make it fast as i have to order ."Small" is a vague, relative term. It's the volume of data that matters more I would think, and I'm guessing your table is "large" for the hardware you are running on. In any case, if you are truly doing the select to "push it in some target table" then I would say first off, you don't need the "order by" in this query. Secondly, if you are really trying to load data to a table, perhaps it is the insert that you don't show here that is the problem?
Check out /*+ APPEND */ and /*+ PARALLEL */ hints just for grins.
MJG -
How to make this faster?? read millions of record from txt file
Hi there,
I got an issue. There is a txt file contains 2 million records, I also got another file contains over 10000 numbers. Now, I need to compare this 10000 numbers with that 2 million records if any records contains a number which belongs to 10000 number set, i retrieve this record and keep it. later on, when i finish the comparison i'll write all the result records into a txt file.
What kind of data structure shall i use to keep the records and numbers? how to make the comparison quicker? Any idea will do!
Thanks!if i were to do it, i will insert bout the records into the db. then do an sql statement on the two tables to get the results. Then get the rs and output it to another text file.
just my opinion. not sure if this is faster.
Message was edited by:
clarenceloh -
How to make Mavericks faster on an "older" MacBook Pro?
I have a late 2011 MacBook Pro, 2.2 GHz core i7 with 4 GB of RAM. I recently wiped my computer and restored to factory settings because it was getting slow, then I upgraded to Mavericks and it is even slower. It freezes often and takes a long time to load things. Is there any way to make it faster or improve it's function?
Oh wow, I must be REALLY out of it, haha, don't know how I missed that.
Hardware Information:
MacBook Pro (15-inch, Late 2011)
MacBook Pro - model: MacBookPro8,2
1 2.2 GHz Intel Core i7 CPU: 4 cores
4 GB RAM
Video Information:
Intel HD Graphics 3000 - VRAM: 384 MB
AMD Radeon HD 6750M - VRAM: 512 MB
System Software:
OS X 10.9.1 (13B42) - Uptime: 0 days 4:2:0
Disk Information:
TOSHIBA MK5065GSXF disk0 : (500.11 GB)
EFI (disk0s1) <not mounted>: 209.7 MB
Dalek Caan (disk0s2) /: 499.25 GB (466.87 GB free)
Recovery HD (disk0s3) <not mounted>: 650 MB
MATSHITADVD-R UJ-8A8
USB Information:
Apple Inc. FaceTime HD Camera (Built-in)
Iomega Iomega Select HDD 500.11 GB
EFI (disk1s1) <not mounted>: 209.7 MB
FAT-32 (disk1s2) /Volumes/FAT-32: 400.11 GB (48.79 GB free)
Mac (disk1s3) /Volumes/Mac: 99.66 GB (27.63 GB free)
Apple Inc. Apple Internal Keyboard / Trackpad
Apple Inc. BRCM2070 Hub
Apple Inc. Bluetooth USB Host Controller
Apple Computer, Inc. IR Receiver
FireWire Information:
Thunderbolt Information:
Apple Inc. thunderbolt_bus
Kernel Extensions:
Problem System Launch Daemons:
Problem System Launch Agents:
Launch Daemons:
[loaded] com.google.keystone.daemon.plist 3rd-Party support link
Launch Agents:
[loaded] com.google.keystone.agent.plist 3rd-Party support link
User Launch Agents:
[loaded] com.valvesoftware.steamclean.plist 3rd-Party support link
User Login Items:
iTunesHelper
Steam
Internet Plug-ins:
googletalkbrowserplugin: Version: 4.9.1.16010 3rd-Party support link
QuickTime Plugin: Version: 7.7.3
o1dbrowserplugin: Version: 4.9.1.16010 3rd-Party support link
npgtpo3dautoplugin: Version: 0.1.44.29 - SDK 10.5 3rd-Party support link
Default Browser: Version: 537 - SDK 10.9
Audio Plug-ins:
BluetoothAudioPlugIn: Version: 1.0 - SDK 10.9
AirPlay: Version: 1.9 - SDK 10.9
AppleAVBAudio: Version: 2.0.0 - SDK 10.9
iSightAudio: Version: 7.7.3 - SDK 10.9
3rd Party Preference Panes:
None
Bad Fonts:
None
Old Applications:
/Library/Printers/EPSON/InkjetPrinter2/Utility/UT4
Epson Printer Utility 4: Version: 9.14 - SDK 10.5 3rd-Party support link
EpsonSuppliesTool4: Version: 8.61 - SDK 10.5 3rd-Party support link
MiroVideoConverter: Version: 2.6 - SDK 10.0 3rd-Party support link
Time Machine:
Time Machine not configured!
Top Processes by CPU:
10% Skype
5% WindowServer
3% VLC
2% EtreCheck
1% coreaudiod
Top Processes by Memory:
182 MB Google Chrome Helper
131 MB VLC
123 MB Google Chrome
119 MB Skype
102 MB Mail
Virtual Memory Information:
42 MB Free RAM
1.49 GB Active RAM
1.45 GB Inactive RAM
960 MB Wired RAM
1.17 GB Page-ins
2 MB Page-outs -
How to make INSERT INTO multitable
Hello everybody, Could you please to explain me how can I make insert in both different table (SQLite)
private void save_ButtonActionPerformed(java.awt.event.ActionEvent evt) {
try{
String sql="Insert into employee, values(?) into department, values(?)";
ps=con.prepareStatement(sql);
ps.setString(1, txt_Surname_Last.getText());
ps.setString(1, txt_Dep.getText());
ps.execute();
}catch(Exception e){
JOptionPane.showMessageDialog(null, e);
Edited by: 999667 on Apr 11, 2013 11:13 PMI suggest you insert into both tables separately, with both in the same transaction so you can rollback all changes if one of the inserts fails.
Also, put all your code in a try/catch/finally block, and close the resultSet, preparedStatemnt, and connection in the finally block.
You can search Google for examples of how to do the above.
I also suggest you form the sql statments as follows
String sql1 ="Insert into employee (employeeId,name), values(?,?);
String sql2 = "Insert into department (departmentId,name) values(?,?)"; -
How to make Portal faster?
Hi all,
The portal on which i am working has become very slow.It is NW04S Portal.
It is taking a lot of time for processing.
Can any one tell me <b>how to make my portal</b> <b>faster</b> by cleaning or any stuff.
I vl award points if it is helpful to me.
Thanks in advance.
Message was edited by:
Satish Dhanalakoti
Message was edited by:
Satish DhanalakotiHi,
Refer this link
https://websmp101.sap-ag.de/~form/sapnet?_SHORTKEY=01200252310000061538&_SCENARIO=01100035870000000112&_OBJECT=011000358700000590032004E
Regards,
Senthil K.
Maybe you are looking for
-
Boot Camp can't create a Windows partition
Hello, I'm trying to create a new partition to install Windows 7 on, but I am unable to do so. At first I tried to do this with Boot Camp Assistant, but it didn't work. Then I tried to create a FAT partition with Disk Utility, which didn't work eithe
-
"rdmgr -n " commnad utility hangs after purging database
Hi, Version: SunOne Portal 6.0 I did the following steps: 1. Started Robot process. 2. Run command "rdmgr -n". It returns count as 25. 3. Purge database without stopping the robot. 4. On running command "rdmgr -n ", it hangs. Stopped the robot proces
-
HT1719 Autofill 4th gen shuffle
I go to autofill, click on it and get error message: "Itunes cannot add anymore songs to the ipod .... because no more free space is available." Why am I getting this error?
-
Only part of my library will transfer to my new computer
I bought a new computer and when i attempted to transfer my iTunes libary to the new computer, it said there were too many users on the account. I have purchased various ipods and iPads for my wife and children, but they all have a separate iTunes ac
-
OSB does not return SOAP fault
We created a custom webservice using a WSDL. We have the following code within the generated Impl class: LOG.debug("caught Exception sendAlertMessage:" + exc.getMessage()); SOAPFault sf = null; try { SOAPFactory fac = SOAPFactory.newInstance(SOAPCons