Query with parameter as Array (UDT) very slow
Hi.
I have following Problem. I try to use Oracle Instant Client 11 and ODP.NET to pass Arrays in SELECT statements as Bind Parameters. I did it, but it runs very-very slow. Example:
- Inittial Query:
SELECT tbl1.field1, tbl1.field2, tbl2.field1, tbl2.field2 ... FROM tbl1
LEFT JOIN tbl2 ON tbl1.field11=tbl2.field0
LEFT JOIN tbl3 ON tbl2.field11=tbl3.field0 AND tbll1.field5=tbl3.field1
...and another LEFT JOINS
WHERE
tbl1.field0 IN ('id01', 'id02', 'id03'...)
this query with 100 elements in "IN" on my database takes 3 seconds.
- Query with Array bind:
in Oracle I did UDT: create or replace type myschema.mytype as table of varchar2(1000)
than, as described in Oracle Example I did few classes (Factory and implementing IOracleCustomType) and use it in Query,
instead of IN ('id01', 'id02', 'id03'...) I have tbl1.field0 IN (select column_value from table(:prmTable)), and :prmTable is bound array.
this query takes 190 seconds!!! Why? I works, but the HDD of Oracle server works very hard, and it takes too long.
Oracle server we habe 10g.
PS: I tried to use only 5 elements in array - the same result, it takes also 190 seconds...
Please help!
I did (some time ago and it was a packaged procedure) something like
Procedure p(p_one in datatype,p_two in datatype,p_dataset out sys_refcursor) is
the_sql varchar2(32000);
the_cursor sys_refcursor;
begin
the_sql = 'WITH NOTIFICACAO AS( ' ||
' SELECT ' ||
' t1.cd_consultora, ' ||
' where t1.dt_notificacao_cn >= to_date(''01/09/2006'',''dd/mm/yyyy'') ' || -- note the ''
' where rownum <= :W_TO_REC) ' || -- parameter 1
' where r_linha >= :W_FROM_REC '; -- parameter 2
open the_cursor for the_sql using p_one,p_two; -- just by the book
end p;if I remember correctly
Regards
Etbin
Similar Messages
-
Query with column is null is very slow
I have a query - select * from grv3que where gq_process_date is null;
that is very slow when returned 4 records (the table has total 60000 records).
SQL> desc grv3que
Name Null? Type
GQ_ID NOT NULL NUMBER(15)
GQ_MESSAGE LONG
GQ_RECEIVE_DATE DATE
GQ_PROCESS_DATE DATE
GQ_CONTROL_ID NOT NULL VARCHAR2(20)
and it has two indexes:
SQL> select index_name, index_type from dba_indexes where table_name='GRV3QUE';
INDEX_NAME INDEX_TYPE
PK_GRV3QUE NORMAL
IDX_GQ_PROCESS_DATE NORMAL
Analyzing the table/indexes didn't help on the performance.
Could you help us how to tune the query? Thanks in advance!!!DOM@DOM11gR1>create table t1
2 as
3 select rownum col1
4 , case when mod(rownum,250000) = 0 then null else sysdate end col2
5 from dual
6 connect by rownum <= 1000000;
Table created.
Elapsed: 00:00:02.03
DOM@DOM11gR1>
DOM@DOM11gR1>create index i_t1_1 on t1 (col2);
Index created.
Elapsed: 00:00:01.03
DOM@DOM11gR1>
DOM@DOM11gR1>explain plan for
2 select *
3 from t1
4 where col2 is null;
Explained.
Elapsed: 00:00:00.02
DOM@DOM11gR1>
DOM@DOM11gR1>select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 3617692013
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 28 | 616 | 696 (2)| 00:00:09 |
|* 1 | TABLE ACCESS FULL| T1 | 28 | 616 | 696 (2)| 00:00:09 |
Predicate Information (identified by operation id):
PLAN_TABLE_OUTPUT
1 - filter("COL2" IS NULL)
Note
- dynamic sampling used for this statement
17 rows selected.
Elapsed: 00:00:00.01
DOM@DOM11gR1>
DOM@DOM11gR1>select nvl2(null,1,2), nvl2('X',1,2) from dual;
NVL2(NULL,1,2) NVL2('X',1,2)
2 1
Elapsed: 00:00:00.01
DOM@DOM11gR1>
DOM@DOM11gR1>create index i_t1_2 on t1 (nvl2(col2,null,1));
Index created.
Elapsed: 00:00:00.07
DOM@DOM11gR1>
DOM@DOM11gR1>explain plan for
2 select *
3 from t1
4 where nvl2(col2,null,1) = 1;
Explained.
Elapsed: 00:00:00.00
DOM@DOM11gR1>
DOM@DOM11gR1>select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 2708798483
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 28 | 616 | 2 (0)| 00:00:01 |
| 1 | TABLE ACCESS BY INDEX ROWID| T1 | 28 | 616 | 2 (0)| 00:00:01 |
|* 2 | INDEX RANGE SCAN | I_T1_2 | 4596 | | 1 (0)| 00:00:01 |
Predicate Information (identified by operation id):
PLAN_TABLE_OUTPUT
2 - access(NVL2("COL2",NULL,1)=1)
Note
- dynamic sampling used for this statement
18 rows selected.
Elapsed: 00:00:00.02
DOM@DOM11gR1>select *
2 from t1
3 where nvl2(col2,null,1) = 1;
COL1 COL2
500000
750000
1000000
250000
Elapsed: 00:00:00.01
DOM@DOM11gR1> -
CANT execute query with parameter on user defined tables using query genera
Dear All,
I have problem when executing query with parameter on user defined tables using query generator.
It seems SBO cannot accept parameter to query user defined tables.
I've tried these:
SELECT T0.U_Status FROM [@ST_PR_H] T0 WHERE T0.U_Status = [%0] --- this FAIL
I try to pass the value directly without using parameter and It works
SELECT T0.U_Status FROM [@ST_PR_H] T0 WHERE T0.U_Status = 2 --- this SUCCESS
This one works
SELECT * FROM RDOC T0 WHERE T0.width =[%0] --- this SUCCESS
and this one works too
SELECT * FROM RDOC T0 WHERE T0.width = 595 --- this SUCCESS
Is there anyone can help me ....???
Thanks,
AlfaI generated this code using query wizard ....
SELECT T0.[U_Status] AS 'Document Status' FROM [dbo].[@ST_PR_H] T0 WHERE T0.[U_Status] = (N'2' )
and replaced the (N'2' ) with [%0]
SELECT T0.[U_Status] AS 'Document Status' FROM [dbo].[@ST_PR_H] T0 WHERE T0.[U_Status] = [%0]
and It worked ......
Thanks 4 all ..... -
Send values to IN query with parameter
Subject: send values to IN query with parameter
Hello. Hope I'll explain my problem well enough:
I have a query:
-- select id from table where id in ('100')
Now I used parameter for the IN part:
-- select id from table where id in (:param)
and I gave the parameter the value 100.
now I want to have the query with two values:
-- select id from table where id in ('100','200')
I tried to use the parameter and give him the value of: '100','200'.
It didn't worked :(
Is there a syntax to give the parameter more then one value for the IN query (with out using another table or function etc')?
Thanks in advance,Roy.This is the best solution I have for it.
variable parameter varchar2(4000);
exec :parameter := 'SYSTEM,SYS';
select username
from dba_users
where username in ( select COLUMN_VALUE from table (split_string(:parameter,',')))It uses this function
CREATE OR REPLACE
type string_table as table of varchar2(4000)
CREATE OR REPLACE
FUNCTION split_string (
string IN varchar2,
delimiter IN varchar2
) RETURN string_table IS
tab string_table;
pre integer;
post integer;
step integer;
i integer;
BEGIN
pre := 1;
step := length(delimiter);
i := 0;
tab := string_table();
loop
tab.extend;
i := i + 1;
post := instr(string,delimiter,pre);
if ( post = 0 ) then
tab(i) := substr(string,pre);
return tab;
end if;
tab(i) := substr(string,pre,post-pre);
pre := post + step;
end loop;
END;
/Bye Alessandro -
have 2009 time capsule with 6 month old iMac very slow ...cox said to replace with new router or extreme with new wifi ???? confused
Replace the Time Capsule with a new one or replace your router with an Airport Extreme Base Station that has faster Wi-Fi. Or you could just connect your old Time Capsule using an Ethernet connection from the Time Capsule to the computer's Ethernet port.
-
Since I've up-dated iPad 2 with IOS7, the typing is very slow. What should I do ?
Since I've up-dated iPad 2 with IOS7, the typing is very slow. What should I do ?
(A) Reset all settings
Settings>General>Reset>Reset All Settings
Note: Data will not be affected but settings will be reset.
(B) Go to Settings>iCloud>Turn off Documents & Data>Restart your iPad. -
Using sql query with parameter
OK, I can't find any docs on this. I can insert a parameter, but how do I insert that into the sql query?
Your first post asked how to insert a paremeter into a SQL. My example shows a value read query with a SQL function, but any SQL will work with any Query in the same pattern.
a) You call the query with session.executeQuery(query, vectorOfArguments);
b) You use #argument in the SQL string and then query.addArgument("argument");
c) You pass them in a Vector of the order in which you do the addArgument's.
- Don -
Some time ago I opened a link in an email from a friend and later found out that his email address had been hijacked. The site the link took me to seemed innocuous, but ever since it seems that from time to time that my internet connection is very slow, as if there is not enough band width. Is it possible that my computer is infected with some sort of malware? How can I determine that? If it is infected how can the malware be removed?
Here is the report.
Problem description:
I clicked on a link in a email from a hacked email account and since then my internet connection runs very slow at times. I am concerned that my iMac may be infected with some sort of Malware
EtreCheck version: 2.1.6 (109)
Report generated January 21, 2015 at 12:26:10 PM MST
Download EtreCheck from http://etresoft.com/etrecheck
Click the [Support] links for help with non-Apple products.
Click the [Details] links for more information about that line.
Click the [Adware] links for help removing adware.
Hardware Information: ℹ️
iMac (21.5-inch, Late 2009) (Technical Specifications)
iMac - model: iMac10,1
1 3.06 GHz Intel Core 2 Duo CPU: 2-core
12 GB RAM Upgradeable
BANK 0/DIMM0
4 GB DDR3 1067 MHz ok
BANK 1/DIMM0
4 GB DDR3 1067 MHz ok
BANK 0/DIMM1
2 GB DDR3 1067 MHz ok
BANK 1/DIMM1
2 GB DDR3 1067 MHz ok
Bluetooth: Old - Handoff/Airdrop2 not supported
Wireless: en1: 802.11 a/b/g/n
Video Information: ℹ️
NVIDIA GeForce 9400 - VRAM: 256 MB
iMac 1920 x 1080
System Software: ℹ️
OS X 10.10.1 (14B25) - Time since boot: 1:8:36
Disk Information: ℹ️
WDC WD5000AAKS-40V2B0 disk0 : (500.11 GB)
EFI (disk0s1) <not mounted> : 210 MB
Macintosh HD (disk0s2) / : 499.25 GB (398.65 GB free)
Recovery HD (disk0s3) <not mounted> [Recovery]: 650 MB
PIONEER DVD-RW DVRTS09
USB Information: ℹ️
Apple Inc. Built-in iSight
Apple Internal Memory Card Reader
Apple Computer, Inc. IR Receiver
Apple Inc. BRCM2046 Hub
Apple Inc. Bluetooth USB Host Controller
Gatekeeper: ℹ️
Mac App Store and identified developers
Kernel Extensions: ℹ️
/Library/Extensions
[loaded] com.symantec.kext.SymAPComm (12.7.1f4 - SDK 10.8) [Support]
[loaded] com.symantec.kext.filesecurity (12.7f4 - SDK 10.8) [Support]
[loaded] com.symantec.kext.fw (5.3.1f4 - SDK 10.8) [Support]
[loaded] com.symantec.kext.internetSecurity (5.4f4 - SDK 10.8) [Support]
[loaded] com.symantec.kext.ips (3.9.2f1 - SDK 10.8) [Support]
[loaded] com.symantec.kext.pf (5.7.1f4 - SDK 10.8) [Support]
/System/Library/Extensions
[not loaded] com.seagate.driver.PowSecDriverCore (5.2.4 - SDK 10.4) [Support]
/System/Library/Extensions/Seagate Storage Driver.kext/Contents/PlugIns
[not loaded] com.seagate.driver.PowSecLeafDriver_10_4 (5.2.4 - SDK 10.4) [Support]
[not loaded] com.seagate.driver.PowSecLeafDriver_10_5 (5.2.4 - SDK 10.5) [Support]
[not loaded] com.seagate.driver.SeagateDriveIcons (5.2.4 - SDK 10.4) [Support]
Launch Agents: ℹ️
[running] com.brother.LOGINserver.plist [Support]
[loaded] com.google.keystone.agent.plist [Support]
[loaded] com.symantec.errorreporter-periodicagent.plist [Support]
[loaded] com.symantec.nis.application.plist [Support]
[running] com.symantec.uiagent.application.plist [Support]
Launch Daemons: ℹ️
[loaded] com.adobe.fpsaud.plist [Support]
[running] com.fitbit.galileod.plist [Support]
[loaded] com.google.keystone.daemon.plist [Support]
[running] com.sec.faxdb.plist [Support]
[running] com.symantec.deepsight-extractor.plist [Support]
[loaded] com.symantec.errorreporter-periodic.plist [Support]
[loaded] com.symantec.liveupdate.daemon.ondemand.plist [Support]
[loaded] com.symantec.liveupdate.daemon.plist [Support]
[invalid?] com.symantec.MissedTasks.plist [Support]
[not loaded] com.symantec.nav.migrateqtf.plist [Support]
[invalid?] com.symantec.Sched501-1.plist [Support]
[running] com.symantec.sharedsettings.plist [Support]
[running] com.symantec.symdaemon.plist [Support]
[invalid?] com.symantec.symSchedDaemon.plist [Support]
User Launch Agents: ℹ️
[loaded] com.adobe.ARM.[...].plist [Support]
[invalid?] com.google.GoogleContactSyncAgent.plist [Support]
User Login Items: ℹ️
Microsoft AU Daemon Application (/Applications/Microsoft AutoUpdate.app/Contents/MacOS/Microsoft AU Daemon.app)
Fitbit Connect Menubar Helper Application (/Applications/Fitbit Connect.app/Contents/MacOS/Fitbit Connect Menubar Helper.app)
Internet Plug-ins: ℹ️
o1dbrowserplugin: Version: 5.38.6.0 - SDK 10.8 [Support]
Default Browser: Version: 600 - SDK 10.10
Flip4Mac WMV Plugin: Version: 2.3.8.1 [Support]
AdobePDFViewerNPAPI: Version: 11.0.10 - SDK 10.6 [Support]
FlashPlayer-10.6: Version: 16.0.0.257 - SDK 10.6 [Support]
Silverlight: Version: 5.1.30317.0 - SDK 10.6 [Support]
Flash Player: Version: 16.0.0.257 - SDK 10.6 [Support]
iPhotoPhotocast: Version: 7.0
googletalkbrowserplugin: Version: 5.38.6.0 - SDK 10.8 [Support]
QuickTime Plugin: Version: 7.7.3
AdobePDFViewer: Version: 11.0.10 - SDK 10.6 [Support]
CouponPrinter-FireFox_v2: Version: Version 1.1.6 [Support]
GarminGpsControl: Version: 2.9.3.0 Release [Support]
NortonInternetSecurityBF: Version: 1.11.0 - SDK 10.6 [Support]
JavaAppletPlugin: Version: 15.0.0 - SDK 10.10 Check version
User internet Plug-ins: ℹ️
Google Earth Web Plug-in: Version: 7.1 [Support]
Safari Extensions: ℹ️
Norton Internet Security [Installed]
3rd Party Preference Panes: ℹ️
Flash Player [Support]
Flip4Mac WMV [Support]
Norton\nQuickMenu [Support]
Time Machine: ℹ️
Skip System Files: NO
Mobile backups: OFF
Auto backup: NO - Auto backup turned off
Volumes being backed up:
Macintosh HD: Disk size: 499.25 GB Disk used: 100.60 GB
Destinations:
Seagate Backup Plus Drive [Local]
Total size: 1.00 TB
Total number of backups: 15
Oldest backup: 2013-08-01 22:49:49 +0000
Last backup: 2014-11-06 19:34:10 +0000
Size of backup disk: Adequate
Backup size 1.00 TB > (Disk used 100.60 GB X 3)
Top Processes by CPU: ℹ️
5% WindowServer
1% Fitbit Connect Menubar Helper
0% fontd
0% AppleSpell
0% launchservicesd
Top Processes by Memory: ℹ️
580 MB com.apple.dock.extra
322 MB SymDaemon
206 MB Google Chrome
168 MB spindump
155 MB mds_stores
Virtual Memory Information: ℹ️
7.46 GB Free RAM
2.59 GB Active RAM
1.51 GB Inactive RAM
1.05 GB Wired RAM
2.56 GB Page-ins
0 B Page-outs
Diagnostics Information: ℹ️
Jan 21, 2015, 11:23:52 AM /Library/Logs/DiagnosticReports/rpcsvchost_2015-01-21-112352_[redacted].cpu_res ource.diag [Details]
Jan 21, 2015, 11:18:14 AM Self test - passed -
Dear all
I bought two days ago HP Deskjet 3520 e-All-in one printer serie, but i have some really bad issues with the scanner! I have searched on the internet and i couldn’t find anything to solve the problem.
I have installed the printer according to the book of the printer, so everything did go well(i think), except that i can’t connect the scan to my computer, a Mac OS X (i am connected with the printer). I get directed to the website where i can connect the scanner, but every time i try to connect it with wi-fi, i get two notification, one from my computer (from HP Itility (Dutch) program) that the connection is off and second from the website that i have to make sure that i’m connected with internet (which i am) and to check the IP address if it is the same with my computer (which is the same).
Obesely something did go wrong, but i can’t find the problem.
Beside when its copy or prints a document (no matter how many pages) it’s very slow. It takes 10 -15 minutes till the printer starts. Has it something to do with the problem i’ve got with the scanner or is the printer always so slow? Because the very first time, when i installed the printer, it printed very fast.
By the way i also print the test-results to check if there is a problem, but according to test-results there are no problems at all.
I hope that someone recognize this problem and can help me to solve it.
Regards,
EsraHello chesterpascual,
Welcome to the HP Support Forums!
Regarding the Deskjet 3520 and the error to use setup cartridges, you will need to call HP's Technical Support to see about sending some to you.
Click here to locate the contact information.
Regards,
JERENDS
I work on behalf of HP
Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
Click the “Kudos Thumbs Up" to the left of the reply button to say “Thanks” for helping! -
Satellite C660 with Windows 8.1 is very slow
I upgraded windows 7 to 8.1 and it was very slow, the disk is always in 100 usage.
When I had the Windows 7 I never had the computer slow.An entry is listed on your screenshot Tareas en segundo plano de proteccion
Its Windows Background Tasks protection srtasks.exe
This process starts automatically and should not cause any performance issues.
However, in case you have still problems with this exe file, I would recommend you to check the system for possible virus and malware.
Sometimes the viruses look very similar to the standard windows processes an could affect the system performance as well as the functionality. -
SQL Query With Like Operator - Performance is very poor - Oracle Apps Table
Hi,
I'm querying one of the Oracle Applications Standard Table. The performance is very slow when like operator is used in the query condition. The query uses a indexed column in the where clause.
The query is..
select * from hz_parties
where upper(party_name) like '%TOY%'
In the above case, It is not using the index and doing full table scan. I have checked the explain plan and the cost is 4496.
select * from hz_parties
where upper(party_name) like 'TOY%'
If I remove the '%' at the begining of the string, the performance is good and it is using the index. In this case, the cost is 5.
Any ideas to improve the performance of the above query. I have to retrieve the records whose name contains the string. I have tried hints to force the use of index. But it is of no use.
Thanks,
RamaIf new indexes are disallowed, not a lot of good ones, no.
If you know what keyword(s) are going to be searched for, a materialized view might help, but I assume that you're searching based on user input. In that case, you'd have to essentially build your own Text index using materialized views, which will almost certainly be less efficient and require more maintenance than the built-in functionality.
There may not be much you could do to affect the query plan in a reasonable way. Depending on the size of the table, how much RAM you're willing to throw at the problem, how your system is administered, and what Oracle Apps requires/ prohibits in terms of database configuration, you might be able to force Oracle to cache this table so that your full table scans are at least more efficient.
Justin -
[11g R2] Update-Select with BITMAP CONVERSION TO ROWIDS = very slow
Hi all,
I have to deal with some performance issues in our database.
The query below takes between 30 minutes and 60 minutes to complete (30 minutes during the batch process and 1h when I executed the query with SQLPLUS):
SQL_ID 4ky65wauhg1ub, child number 0
UPDATE fiscpt x SET (x.cimld) = (SELECT COUNT (*)
FROM fiscpt f WHERE f.comar = x.comar AND
f.coint = x.coint AND f.nucpt = x.nucpt AND
f.codev != x.codev AND f.cimvt != 0) WHERE x.comar IN
('CBOT', 'CME', 'EUREX', 'FOREX', 'LIFFE', 'METAL', 'OCC')
Plan hash value: 697684605
| Id | Operation | Name | Starts | E-Rows |E-Bytes| Cost (%CPU)| E-Time | A-Rows | A-Time | Buffers | Reads | OMem | 1Mem | Used-Mem |
| 0 | UPDATE STATEMENT | | 1 | | | 773K(100)| | 0 |00:22:22.30 | 36M| 7629 | | | |
| 1 | UPDATE | FISCPT | 1 | | | | | 0 |00:22:22.30 | 36M| 7629 | | | |
| 2 | INLIST ITERATOR | | 1 | | | | | 179K|00:00:00.37 | 1221 | 3 | | | |
|* 3 | INDEX RANGE SCAN | FISCPT1 | 7 | 154K| 4984K| 5 (0)| 00:00:01 | 179K|00:00:00.23 | 1221 | 3 | | | |
| 4 | SORT AGGREGATE | | 179K| 1 | 33 | | | 179K|01:02:58.45 | 35M| 3020 | | | |
|* 5 | TABLE ACCESS BY INDEX ROWID | FISCPT | 179K| 1 | 33 | 4 (25)| 00:00:01 | 63681 |01:02:57.80 | 35M| 3020 | | | |
| 6 | BITMAP CONVERSION TO ROWIDS | | 179K| | | | | 121K|01:02:52.71 | 35M| 885 | | | |
| 7 | BITMAP AND | | 179K| | | | | 87091 |01:02:52.25 | 35M| 885 | | | |
| 8 | BITMAP CONVERSION FROM ROWIDS| | 179K| | | | | 179K|00:00:03.31 | 241K| 0 | | | |
|* 9 | INDEX RANGE SCAN | FISCPT2 | 179K| 1547 | | 1 (0)| 00:00:01 | 1645K|00:00:02.23 | 241K| 0 | | | |
| 10 | BITMAP CONVERSION FROM ROWIDS| | 179K| | | | | 148K|01:02:44.98 | 35M| 885 | | | |
| 11 | SORT ORDER BY | | 179K| | | | | 2412M|00:52:19.70 | 35M| 885 | 1328K| 587K| 1180K (0)|
|* 12 | INDEX RANGE SCAN | FISCPT1 | 179K| 1547 | | 2 (0)| 00:00:01 | 2412M|00:22:11.22 | 35M| 885 | | | |
Query Block Name / Object Alias (identified by operation id):
1 - UPD$1
3 - UPD$1 / X@UPD$1
4 - SEL$1
5 - SEL$1 / F@SEL$1
Predicate Information (identified by operation id):
3 - access(("X"."COMAR"='CBOT' OR "X"."COMAR"='CME' OR "X"."COMAR"='EUREX' OR "X"."COMAR"='FOREX' OR "X"."COMAR"='LIFFE' OR "X"."COMAR"='METAL' OR
"X"."COMAR"='OCC'))
5 - filter("F"."CIMVT"<>0)
9 - access("F"."COINT"=:B1 AND "F"."NUCPT"=:B2)
12 - access("F"."COMAR"=:B1)
filter(("F"."CODEV"<>:B1 AND "F"."COMAR"=:B2))
Column Projection Information (identified by operation id):
2 - (upd=6; cmp=2,3,4,5) "SYS_ALIAS_4".ROWID[ROWID,10], "X"."COMAR"[VARCHAR2,5], "X"."COINT"[VARCHAR2,11], "X"."NUCPT"[VARCHAR2,8], "X"."CODEV"[VARCHAR2,3],
"X"."CIMLD"[NUMBER,22]
3 - "SYS_ALIAS_4".ROWID[ROWID,10], "X"."COMAR"[VARCHAR2,5], "X"."COINT"[VARCHAR2,11], "X"."NUCPT"[VARCHAR2,8], "X"."CODEV"[VARCHAR2,3], "X"."CIMLD"[NUMBER,22]
4 - (#keys=0) COUNT(*)[22]
5 - "F".ROWID[ROWID,10], "F"."COMAR"[VARCHAR2,5], "F"."COINT"[VARCHAR2,11], "F"."NUCPT"[VARCHAR2,8], "F"."CODEV"[VARCHAR2,3], "F"."CIMVT"[NUMBER,22]
6 - "F".ROWID[ROWID,10]
7 - STRDEF[BM VAR, 10], STRDEF[BM VAR, 10], STRDEF[BM VAR, 32496]
8 - STRDEF[BM VAR, 10], STRDEF[BM VAR, 10], STRDEF[BM VAR, 32496]
9 - "F".ROWID[ROWID,10]
10 - STRDEF[BM VAR, 10], STRDEF[BM VAR, 10], STRDEF[BM VAR, 32496]
11 - (#keys=1) "F".ROWID[ROWID,10]
12 - "F".ROWID[ROWID,10]
Note
- dynamic sampling used for this statement (level=2)We intentionally don't gather statistics on the FISCPT table.
There are no indexes on the column updated so the slowness is not due to updating of indexes:
SQL> select index_name, column_name from user_ind_columns where table_name='FISCPT';
INDEX_NAME COLUMN_NAM
FISCPT1 NUCPT
FISCPT1 CODEV
FISCPT1 RGCID
FISCPT1 DATRA
FISCPT2 COINT
FISCPT2 NUCPT
FISCPT3 NUFIS
FISCPT1 COINT
FISCPT1 COMAR
9 ligne(s) sÚlectionnÚe(s).
SQL> select count(1) from FISCPT;
COUNT(1)
179369If I replace the UPDATE-SELECT statement by a SELECT, the query runs in few seconds:
SQL> SELECT COUNT (*)
2 FROM fiscpt f, fiscpt x
3 WHERE f.comar = x.comar
4 AND f.coint = x.coint
5 AND f.nucpt = x.nucpt
6 AND f.codev != x.codev
7 AND f.cimvt != 0
8 and x.comar IN ('CBOT', 'CME', 'EUREX', 'FOREX', 'LIFFE', 'METAL', 'OCC');
COUNT(*)
63681
EcoulÚ : 00 :00 :00.75
SQL> select * from table(dbms_xplan.display_cursor());
PLAN_TABLE_OUTPUT
SQL_ID 5drbpdmdv0gv1, child number 0
SELECT COUNT (*) FROM fiscpt f, fiscpt x
WHERE f.comar = x.comar AND f.coint = x.coint
AND f.nucpt = x.nucpt AND f.codev != x.codev
AND f.cimvt != 0 and x.comar IN ('CBOT', 'CME', 'EUREX', 'FOREX',
'LIFFE', 'METAL', 'OCC')
Plan hash value: 1326101771
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | | 2477 (100)| |
| 1 | SORT AGGREGATE | | 1 | 53 | | | |
|* 2 | HASH JOIN | | 107K| 5557K| 4720K| 2477 (1)| 00:00:30 |
| 3 | INLIST ITERATOR | | | | | | |
|* 4 | TABLE ACCESS BY INDEX ROWID| FISCPT | 107K| 3460K| | 1674 (1)| 00:00:21 |
|* 5 | INDEX RANGE SCAN | FISCPT1 | 154K| | | 873 (0)| 00:00:11 |
|* 6 | INDEX FAST FULL SCAN | FISCPT1 | 154K| 3021K| | 337 (0)| 00:00:05 |
Predicate Information (identified by operation id):
2 - access("F"."COMAR"="X"."COMAR" AND "F"."COINT"="X"."COINT" AND
"F"."NUCPT"="X"."NUCPT")
filter("F"."CODEV"<>"X"."CODEV")
4 - filter("F"."CIMVT"<>0)
5 - access(("F"."COMAR"='CBOT' OR "F"."COMAR"='CME' OR "F"."COMAR"='EUREX' OR
"F"."COMAR"='FOREX' OR "F"."COMAR"='LIFFE' OR "F"."COMAR"='METAL' OR "F"."COMAR"='OCC'))
6 - filter(("X"."COMAR"='CBOT' OR "X"."COMAR"='CME' OR "X"."COMAR"='EUREX' OR
"X"."COMAR"='FOREX' OR "X"."COMAR"='LIFFE' OR "X"."COMAR"='METAL' OR "X"."COMAR"='OCC'))
Note
- dynamic sampling used for this statement (level=2)The optimizer parameters are at their default values.
The database is an 11.2.0.1 and the OS is a Linux Red hat.
can someone help me to tune this query please?Thanks Tubby for your reply,
We don't gather statistics at all on this table because it's a process table: on the production database we may have several processes which insert/delet/update rows into this table so we prefer to rely on Dynamic Sampling instead of gathering statistics each time a process need to access this table.
I don't dynamic sampling is the problem here because when i use the level 10 the execution plan is the same:
SQL> alter session set optimizer_dynamic_sampling=10;
Session modifiÚe.
EcoulÚ : 00 :00 :00.00
SQL> explain plan for
2 UPDATE fiscpt x
3 SET (x.cimld) =
4 (SELECT COUNT (*)
5 FROM fiscpt f
6 WHERE f.comar = x.comar
7 AND f.coint = x.coint
8 AND f.nucpt = x.nucpt
9 AND f.codev != x.codev
10 AND f.cimvt != 0)
11 WHERE x.comar IN ('CBOT', 'CME', 'EUREX', 'FOREX', 'LIFFE', 'METAL', 'OCC');
ExplicitÚ.
EcoulÚ : 00 :00 :01.04
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 697684605
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | UPDATE STATEMENT | | 179K| 5780K| 896K (20)| 02:59:23 |
| 1 | UPDATE | FISCPT | | | | |
| 2 | INLIST ITERATOR | | | | | |
|* 3 | INDEX RANGE SCAN | FISCPT1 | 179K| 5780K| 5 (0)| 00:00:01 |
| 4 | SORT AGGREGATE | | 1 | 33 | | |
|* 5 | TABLE ACCESS BY INDEX ROWID | FISCPT | 1 | 33 | 4 (25)| 00:00:01 |
| 6 | BITMAP CONVERSION TO ROWIDS | | | | | |
| 7 | BITMAP AND | | | | | |
| 8 | BITMAP CONVERSION FROM ROWIDS| | | | | |
|* 9 | INDEX RANGE SCAN | FISCPT2 | 1794 | | 1 (0)| 00:00:01 |
| 10 | BITMAP CONVERSION FROM ROWIDS| | | | | |
| 11 | SORT ORDER BY | | | | | |
|* 12 | INDEX RANGE SCAN | FISCPT1 | 1794 | | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
3 - access("X"."COMAR"='CBOT' OR "X"."COMAR"='CME' OR "X"."COMAR"='EUREX' OR
"X"."COMAR"='FOREX' OR "X"."COMAR"='LIFFE' OR "X"."COMAR"='METAL' OR
"X"."COMAR"='OCC')
5 - filter("F"."CIMVT"<>0)
9 - access("F"."COINT"=:B1 AND "F"."NUCPT"=:B2)
12 - access("F"."COMAR"=:B1)
filter("F"."CODEV"<>:B1 AND "F"."COMAR"=:B2)
Note
- dynamic sampling used for this statement (level=10)I have tested the query you provided and the execution plan is almost the same (A FILTER clause is added but the COST isthe same):
SQL> explain plan for
2 UPDATE fiscpt x
3 SET (x.cimld) =
4 (SELECT COUNT (*)
5 FROM fiscpt f
6 WHERE f.comar = x.comar
7 AND f.coint = x.coint
8 AND f.nucpt = x.nucpt
9 AND f.codev != x.codev
10 AND f.cimvt != 0
11 and f.comar IN ('CBOT', 'CME', 'EUREX', 'FOREX', 'LIFFE', 'METAL', 'OCC')
12 )
13 WHERE x.comar IN ('CBOT', 'CME', 'EUREX', 'FOREX', 'LIFFE', 'METAL', 'OCC');
ExplicitÚ.
EcoulÚ : 00 :00 :00.01
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 1565986742
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | UPDATE STATEMENT | | 154K| 4984K| 773K (20)| 02:34:41 |
| 1 | UPDATE | FISCPT | | | | |
| 2 | INLIST ITERATOR | | | | | |
|* 3 | INDEX RANGE SCAN | FISCPT1 | 154K| 4984K| 5 (0)| 00:00:01 |
| 4 | SORT AGGREGATE | | 1 | 33 | | |
|* 5 | FILTER | | | | | |
|* 6 | TABLE ACCESS BY INDEX ROWID | FISCPT | 1 | 33 | 4 (25)| 00:00:01 |
| 7 | BITMAP CONVERSION TO ROWIDS | | | | | |
| 8 | BITMAP AND | | | | | |
| 9 | BITMAP CONVERSION FROM ROWIDS| | | | | |
|* 10 | INDEX RANGE SCAN | FISCPT2 | 1547 | | 1 (0)| 00:00:01 |
| 11 | BITMAP CONVERSION FROM ROWIDS| | | | | |
| 12 | SORT ORDER BY | | | | | |
|* 13 | INDEX RANGE SCAN | FISCPT1 | 1547 | | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
3 - access("X"."COMAR"='CBOT' OR "X"."COMAR"='CME' OR "X"."COMAR"='EUREX' OR
"X"."COMAR"='FOREX' OR "X"."COMAR"='LIFFE' OR "X"."COMAR"='METAL' OR "X"."COMAR"='OCC')
5 - filter(:B1='CBOT' OR :B2='CME' OR :B3='EUREX' OR :B4='FOREX' OR :B5='LIFFE' OR
:B6='METAL' OR :B7='OCC')
6 - filter(("F"."COMAR"='CBOT' OR "F"."COMAR"='CME' OR "F"."COMAR"='EUREX' OR
"F"."COMAR"='FOREX' OR "F"."COMAR"='LIFFE' OR "F"."COMAR"='METAL' OR
"F"."COMAR"='OCC') AND "F"."CIMVT"<>0)
10 - access("F"."COINT"=:B1 AND "F"."NUCPT"=:B2)
13 - access("F"."COMAR"=:B1)
filter("F"."CODEV"<>:B1 AND ("F"."COMAR"='CBOT' OR "F"."COMAR"='CME' OR
"F"."COMAR"='EUREX' OR "F"."COMAR"='FOREX' OR "F"."COMAR"='LIFFE' OR
"F"."COMAR"='METAL' OR "F"."COMAR"='OCC') AND "F"."COMAR"=:B2)
Note
- dynamic sampling used for this statement (level=2)I have executed this statement for 50 minutes and it is still running now
Furthermore, I have used the tuning advisor but it has not found any recommendation.
is it normal that oracle takes 1hour to update 175k rows? -
Mac with vpn tracker software running very slow
Hello,
I leave in Seattle and I use a Mac G5 running vpn tracker software tunneling into a Microsoft corporate network in San Jose, CA. My mac is plugged into a router and it is very very slow. I also have a PC with vpn tracker software which is running wireless and it is fast. Any ideas on what I need to do to make the Mac run faster. Could this be issues with my clients network? Should my Mac G5 be running wireless in order to get it running faster? Any advice would be appreciated.
StephenI have the same problem. It is really, really slow. Does Windows work better than the Mac in this respect?
-
Mac Pro with OS mountain lion working very slow
I have a MacBook Pro with OSX 10.8.2. the mac is working very slow. It takes a lot of time to boot. Much longer than windows PC. Applications are also running very slow. How to speed up the mac and improve its performance? Plz help!!!
We're a workstation/tower forum.
Having more RAM has little or diminishing affect unless you are runnning apps that need and can use it (graphics being one, such as CS5 and later).
Many laptop owners and desktop like SSD for shorter boot (Mac always boots fast, quicker than Windows, use both).
If it were me I would
Backup of coure, TimeMachine and maybe one other method or set is useful, then do a clean install and reload the OS and let it do all the updates.
Most of the time after a lot of digging around and questions and answers, it gets down to "Did you install xyz" and a list of 3rd party programs, drivers and apps that you added that aren't part of the core OS or from Apple. Whether Norton (notorious) or some "cleaner" program or even something you need but which may not be compatible with or needed with OS X and Mountain Lion.
You can also set aside 100GB and run Windows natively as well as a guest VM OS.
Along with monitoring RAM, disk activity, I've seen RAM DIMMs that were 'loose' or not fully seated - even though Lion OS ran well the second that they tried to install Windows 7 on their MacBook Pro it had errors and could not complete. They had upgraded the RAM on their own. Just odd that OS X was that immune and insensitive.
But this is best off where others with the very same topic can be found in Mountain Lion and MacBook Pro forums. (we get way too many MBP in Mac Tower Pro) MacBook Pro
https://discussions.apple.com/community/notebooks/macbook_pro
https://discussions.apple.com/community/mac_os/
http://www.apple.com/support/macbookpro -
Pages with many text hyperlinks are very slow
When making a text list, where a lot of the words are hperlinks, the resulting age is very slow with loading.
Also, especially when not using Safari, the screen is garbled with text until the complete page is loaded.
It looks like all those simple text hyperlinks are somehow displayed as pictures???
How can I create plain text hyperlinks without all the overhead added by iWeb?I have converted a list to web => Times New Roman => bolt and regular, but still the same problem.
In the source code this list is build by using img usemap, see part of the code here:
test1
test2
....cut
The solution looks like to recreate all the lists
I will post the result when I have recreated one of the lists.
Maybe you are looking for
-
Although my ipod shows the number of steps, calories, and time, it no longer is saving it to the history. Also when I open the history it takes me to May 2010 instead of the current date. Any ideas on how to get it to start recording the history agai
-
Hello, I am a student, just downloaded SQL DEVELOPER. I need to know how to create a new connection. I followed the HELP button under connection and the following directions bellow: "To create a new database connection, right-click the Connections no
-
Images disappearence in latest build
Hi, I've integrated the new Gumbo build 4.0.0.4904 (with TLF build 357), but there seems to be issue with images. Problem is that of image disappearance. After adding image, type some text and then click mouse close to image, results sometimes in ima
-
Unable to re-install Snow Leopard after upgrading to Mavericks
I upgraded to Mavericks before realizing that my USB microphone interface would no longer work with Mavericks due to the manufacturer not updating drivers... So I need to revert back to Snow Leopard. I don't have a time machine backup from snow leopa
-
Can't delete emails from desktop.
I am unable to delete most of my email messages by clicking on the trash can. The only solution that the advisor could give me was manually highlight the emails I want to delete and drag them to the "on my Mac trash bin" for the sophistication that