Speed up query
hiiiii,,,,
i am running a query in an database stored procedure,but its taking long time to run
Plzz tel me wat are the ways to increase speed of the query.........
Dear user1175303,
You have not mentioned the;
oracle version, what sort of query, what procedure; long time, to whom? the definition of the "long time" 1 second, 10 seconds, 10 hours?
Do you have any idea about what is a CBO?
I presume first you have to tell us some more and then we can have an idea about your problem. Noone will answer your question because we do not know your condition here.
Ogan
Similar Messages
-
Model Aggregate tables to speed up query processing
Hi,
Can anyone help me in the topics
"Model Aggregate Tables to Speed up Query Processing"
"Model Partitions and Fragments to improve application performance and usability"
Am new to this concept, haven't worked on this before.
Regards,
ArunArun wrote:
Thanks. This would definitely help me out. But, i face issue in opening the repository in Online mode. Could you please tell me how to solve this issue?
Here OBIEE server is lying on Unix Environment.
I've created a repository in Windows Client.(Have installed OBIEE 11g developers client, BI Admin tool in my local machine).
I would like to know the way to open a repository file in online mode in Client side.
Regards,
ArunCreate a 'BI Server' type ODBC connection in your windows environment pointing to your Unix box, then when you go open -> Online in admin tool you will see the entry as an option.
Better to start a new thread when your original question is answered. -
Speed up query with analytic function
Hi
how can I speed up the query below ?
All time is in analytic function (WINDOW SORT)
Thanks for your help
11.2.0.1
Rows Row Source Operation
28987 HASH UNIQUE (cr=12677 pr=155778 pw=109730 time=25010 us cost=5502 size=3972960 card=14880)
1668196 WINDOW SORT (cr=12677 pr=155778 pw=109730 time=890411840 us cost=5502 size=3972960 card=14880)
1668196 HASH JOIN RIGHT OUTER (cr=12677 pr=0 pw=0 time=1069165 us cost=3787 size=3972960 card=14880)
30706 TABLE ACCESS FULL FLO_FML_EVENT (cr=270 pr=0 pw=0 time=7420 us cost=56 size=814158 card=30154)
194733 HASH JOIN RIGHT OUTER (cr=12407 pr=0 pw=0 time=571145 us cost=3730 size=3571200 card=14880)
613 VIEW (cr=342 pr=0 pw=0 time=489 us cost=71 size=23840 card=745)
613 HASH UNIQUE (cr=342 pr=0 pw=0 time=244 us cost=71 size=20115 card=745)
745 WINDOW SORT (cr=342 pr=0 pw=0 time=1736 us cost=71 size=20115 card=745)
745 MAT_VIEW ACCESS FULL MVECRF_CUR_QUERY (cr=342 pr=0 pw=0 time=1736 us cost=69 size=20115 card=745)
194733 HASH JOIN (cr=12065 pr=0 pw=0 time=431813 us cost=3658 size=3095040 card=14880)
43 MAT_VIEW ACCESS FULL MVECRF_VISIT_REVS (cr=3 pr=0 pw=0 time=0 us cost=2 size=946 card=43)
194733 HASH JOIN OUTER (cr=12062 pr=0 pw=0 time=292098 us cost=3656 size=2767680 card=14880)
194733 HASH JOIN OUTER (cr=10553 pr=0 pw=0 time=234394 us cost=2962 size=2574240 card=14880)
194733 HASH JOIN (cr=9999 pr=0 pw=0 time=379996 us cost=2570 size=2380800 card=14880)
30076 MAT_VIEW ACCESS FULL MVECRF_ACTIVATED_FORMS (cr=1817 pr=0 pw=0 time=28411 us cost=361 size=2000285 card=29855)
194733 HASH JOIN (cr=8182 pr=0 pw=0 time=209061 us cost=1613 size=9026301 card=97057)
628 MAT_VIEW ACCESS FULL MVECRF_STUDYVERSION_FORMS (cr=19 pr=0 pw=0 time=250 us cost=6 size=18212 card=628)
194733 MAT_VIEW ACCESS FULL MVECRF_FORMITEMS (cr=8163 pr=0 pw=0 time=80733 us cost=1606 size=12462912 card=194733)
132342 MAT_VIEW ACCESS FULL MVECRF_ITEM_SDV (cr=554 pr=0 pw=0 time=23678 us cost=112 size=1720446 card=132342)
221034 MAT_VIEW ACCESS FULL MVECRF_ITEMDATA (cr=1509 pr=0 pw=0 time=46459 us cost=299 size=2873442 card=221034)
SELECT
DISTINCT
'CL238093011' AS ETUDE,
FI.STUDYID,
FI.STUDYVERSIONID,
FI.SITEID,
FI.SUBJECTID,
FI.VISITID,
VR.VISITREFNAME,
FI.SUBJECTVISITID,
FI.FORMID,
FI.FORMINDEX,
SVF.FORMREFNAME,
SVF.FORMMNEMONIC AS FMLNOM,
EVENT_ITEM.EVENT AS EVENUM,
EVENT_ITEM.EVENT_ROW AS LIGNUM,
NULL AS CODVISEVE,
MIN(DID.MINENTEREDDATE)
OVER (
PARTITION BY FI.SUBJECTID, FI.VISITID, FI.FORMID, FI.FORMINDEX
AS ATTDAT1ERSAI,
MIN(IFSDV.ITEMFIRSTSDV)
OVER (
PARTITION BY FI.SUBJECTID, FI.VISITID, FI.FORMID, FI.FORMINDEX
AS ATTDAT1ERSDV,
MAX(IFSDV.ITEMFIRSTSDV)
OVER (
PARTITION BY FI.SUBJECTID, FI.VISITID, FI.FORMID, FI.FORMINDEX
AS ATTDATDERSDV,
DECODE (AF.SDVCOMPLETESTATE,
0,
'N',
1,
'Y')
AS ATTINDSDVCOP,
AF.FMINSDVCOMPLETESTATE AS ATTDAT1ERSDVCOP,
DECODE (AF.SDVPARTIALSTATE,
0,
'N',
1,
'Y')
AS ATTINDSDVPTL,
EVENT_ITEM.EVENT_RELECT AS ATTINDRVUMEDCOP,
DECODE (QUERY.NBQSTFML, NULL, 'N', 'Y') AS ATTINDQST,
DECODE (AF.MISSINGITEMSSTATE,
0,
'N',
1,
'Y')
AS ATTINDITMABS,
DECODE (AF.FROZENSTATE,
0,
'N',
1,
'Y')
AS ATTINDETACON,
AF.FMINFROZENSTATE AS ATTDAT1ERCON,
AF.FMAXFROZENSTATE AS ATTDATDERCON,
DECODE (AF.DELETEDSTATE,
0,
'N',
1,
'Y')
AS ATTINDETASPR,
EVENT_ITEM.ROW_DELETED AS ATTINDLIGSPR
FROM CL238093011.MVECRF_FORMITEMS FI,
CL238093011.MVECRF_STUDYVERSION_FORMS SVF,
CL238093011.MVECRF_ACTIVATED_FORMS AF,
CL238093011.MVECRF_ITEM_SDV IFSDV,
CL238093011.MVECRF_VISIT_REVS VR,
CL238093011.MVECRF_ITEMDATA DID,
(SELECT DISTINCT
SUBJECTID,
VISITID,
FORMID,
FORMINDEX,
COUNT (
DISTINCT QUERYID
OVER (
PARTITION BY SUBJECTID, VISITID, FORMID, FORMINDEX
NBQSTFML
FROM CL238093011.MVECRF_CUR_QUERY
WHERE QUERYSTATE IN (0, 1, 2)) QUERY,
CL238093011.FLO_FML_EVENT EVENT_ITEM
WHERE (AF.VISITDELETED IS NULL OR AF.VISITDELETED = 0)
AND AF.FORMTYPE NOT IN (4, 5, 6, 7, 8, 103)
AND (AF.DELETEDDYNAMICFORMSTATE IS NULL
OR AF.DELETEDDYNAMICFORMSTATE = 0)
AND FI.SUBJECTVISITID = AF.SUBJECTVISITID
AND FI.FORMID = AF.FORMID
AND FI.FORMREV = AF.FORMREV
AND FI.FORMINDEX = AF.FORMINDEX
AND FI.VISITID = VR.VISITID
AND FI.VISITREV = VR.VISITREV
AND FI.CONTEXTID = IFSDV.CONTEXTID(+)
AND FI.CONTEXTID = DID.CONTEXTID(+)
AND FI.SUBJECTID = QUERY.SUBJECTID(+)
AND FI.VISITID = QUERY.VISITID(+)
AND FI.FORMID = QUERY.FORMID(+)
AND FI.FORMINDEX = QUERY.FORMINDEX(+)
AND FI.STUDYVERSIONID = SVF.STUDYVERSIONID
AND FI.FORMID = SVF.FORMID
AND FI.VISITID = SVF.VISITID
AND FI.SUBJECTID = EVENT_ITEM.SUBJECTID(+)
AND FI.VISITID = EVENT_ITEM.VISITID(+)
AND FI.FORMID = EVENT_ITEM.FORMID(+)
AND FI.FORMINDEX = EVENT_ITEM.FORMINDEX(+)user12045475 wrote:
Hi
how can I speed up the query below ?
All time is in analytic function (WINDOW SORT)
Thanks for your help
11.2.0.1
Rows Row Source Operation
28987 HASH UNIQUE (cr=12677 pr=155778 pw=109730 time=25010 us cost=5502 size=3972960 card=14880)
1668196 WINDOW SORT (cr=12677 pr=155778 pw=109730 time=890411840 us cost=5502 size=3972960 card=14880)
1668196 HASH JOIN RIGHT OUTER (cr=12677 pr=0 pw=0 time=1069165 us cost=3787 size=3972960 card=14880)
30706 TABLE ACCESS FULL FLO_FML_EVENT (cr=270 pr=0 pw=0 time=7420 us cost=56 size=814158 card=30154)
194733 HASH JOIN RIGHT OUTER (cr=12407 pr=0 pw=0 time=571145 us cost=3730 size=3571200 card=14880)
613 VIEW (cr=342 pr=0 pw=0 time=489 us cost=71 size=23840 card=745)
613 HASH UNIQUE (cr=342 pr=0 pw=0 time=244 us cost=71 size=20115 card=745)
745 WINDOW SORT (cr=342 pr=0 pw=0 time=1736 us cost=71 size=20115 card=745)
745 MAT_VIEW ACCESS FULL MVECRF_CUR_QUERY (cr=342 pr=0 pw=0 time=1736 us cost=69 size=20115 card=745)
194733 HASH JOIN (cr=12065 pr=0 pw=0 time=431813 us cost=3658 size=3095040 card=14880)
43 MAT_VIEW ACCESS FULL MVECRF_VISIT_REVS (cr=3 pr=0 pw=0 time=0 us cost=2 size=946 card=43)
194733 HASH JOIN OUTER (cr=12062 pr=0 pw=0 time=292098 us cost=3656 size=2767680 card=14880)
194733 HASH JOIN OUTER (cr=10553 pr=0 pw=0 time=234394 us cost=2962 size=2574240 card=14880)
194733 HASH JOIN (cr=9999 pr=0 pw=0 time=379996 us cost=2570 size=2380800 card=14880)
30076 MAT_VIEW ACCESS FULL MVECRF_ACTIVATED_FORMS (cr=1817 pr=0 pw=0 time=28411 us cost=361 size=2000285 card=29855)
194733 HASH JOIN (cr=8182 pr=0 pw=0 time=209061 us cost=1613 size=9026301 card=97057)
628 MAT_VIEW ACCESS FULL MVECRF_STUDYVERSION_FORMS (cr=19 pr=0 pw=0 time=250 us cost=6 size=18212 card=628)
194733 MAT_VIEW ACCESS FULL MVECRF_FORMITEMS (cr=8163 pr=0 pw=0 time=80733 us cost=1606 size=12462912 card=194733)
132342 MAT_VIEW ACCESS FULL MVECRF_ITEM_SDV (cr=554 pr=0 pw=0 time=23678 us cost=112 size=1720446 card=132342)
221034 MAT_VIEW ACCESS FULL MVECRF_ITEMDATA (cr=1509 pr=0 pw=0 time=46459 us cost=299 size=2873442 card=221034)
SELECT
DISTINCT
'CL238093011' AS ETUDE,
FI.STUDYID,
FI.STUDYVERSIONID,
FI.SITEID,
FI.SUBJECTID,
FI.VISITID,
VR.VISITREFNAME,
FI.SUBJECTVISITID,
FI.FORMID,
FI.FORMINDEX,
SVF.FORMREFNAME,
SVF.FORMMNEMONIC AS FMLNOM,
EVENT_ITEM.EVENT AS EVENUM,
EVENT_ITEM.EVENT_ROW AS LIGNUM,
NULL AS CODVISEVE,
MIN(DID.MINENTEREDDATE)
OVER (
PARTITION BY FI.SUBJECTID, FI.VISITID, FI.FORMID, FI.FORMINDEX
AS ATTDAT1ERSAI,
MIN(IFSDV.ITEMFIRSTSDV)
OVER (
PARTITION BY FI.SUBJECTID, FI.VISITID, FI.FORMID, FI.FORMINDEX
AS ATTDAT1ERSDV,
MAX(IFSDV.ITEMFIRSTSDV)
OVER (
PARTITION BY FI.SUBJECTID, FI.VISITID, FI.FORMID, FI.FORMINDEX
AS ATTDATDERSDV,
DECODE (AF.SDVCOMPLETESTATE,
0,
'N',
1,
'Y')
AS ATTINDSDVCOP,
AF.FMINSDVCOMPLETESTATE AS ATTDAT1ERSDVCOP,
DECODE (AF.SDVPARTIALSTATE,
0,
'N',
1,
'Y')
AS ATTINDSDVPTL,
EVENT_ITEM.EVENT_RELECT AS ATTINDRVUMEDCOP,
DECODE (QUERY.NBQSTFML, NULL, 'N', 'Y') AS ATTINDQST,
DECODE (AF.MISSINGITEMSSTATE,
0,
'N',
1,
'Y')
AS ATTINDITMABS,
DECODE (AF.FROZENSTATE,
0,
'N',
1,
'Y')
AS ATTINDETACON,
AF.FMINFROZENSTATE AS ATTDAT1ERCON,
AF.FMAXFROZENSTATE AS ATTDATDERCON,
DECODE (AF.DELETEDSTATE,
0,
'N',
1,
'Y')
AS ATTINDETASPR,
EVENT_ITEM.ROW_DELETED AS ATTINDLIGSPR
FROM CL238093011.MVECRF_FORMITEMS FI,
CL238093011.MVECRF_STUDYVERSION_FORMS SVF,
CL238093011.MVECRF_ACTIVATED_FORMS AF,
CL238093011.MVECRF_ITEM_SDV IFSDV,
CL238093011.MVECRF_VISIT_REVS VR,
CL238093011.MVECRF_ITEMDATA DID,
(SELECT DISTINCT
SUBJECTID,
VISITID,
FORMID,
FORMINDEX,
COUNT (
DISTINCT QUERYID
OVER (
PARTITION BY SUBJECTID, VISITID, FORMID, FORMINDEX
NBQSTFML
FROM CL238093011.MVECRF_CUR_QUERY
WHERE QUERYSTATE IN (0, 1, 2)) QUERY,
CL238093011.FLO_FML_EVENT EVENT_ITEM
WHERE (AF.VISITDELETED IS NULL OR AF.VISITDELETED = 0)
AND AF.FORMTYPE NOT IN (4, 5, 6, 7, 8, 103)
AND (AF.DELETEDDYNAMICFORMSTATE IS NULL
OR AF.DELETEDDYNAMICFORMSTATE = 0)
AND FI.SUBJECTVISITID = AF.SUBJECTVISITID
AND FI.FORMID = AF.FORMID
AND FI.FORMREV = AF.FORMREV
AND FI.FORMINDEX = AF.FORMINDEX
AND FI.VISITID = VR.VISITID
AND FI.VISITREV = VR.VISITREV
AND FI.CONTEXTID = IFSDV.CONTEXTID(+)
AND FI.CONTEXTID = DID.CONTEXTID(+)
AND FI.SUBJECTID = QUERY.SUBJECTID(+)
AND FI.VISITID = QUERY.VISITID(+)
AND FI.FORMID = QUERY.FORMID(+)
AND FI.FORMINDEX = QUERY.FORMINDEX(+)
AND FI.STUDYVERSIONID = SVF.STUDYVERSIONID
AND FI.FORMID = SVF.FORMID
AND FI.VISITID = SVF.VISITID
AND FI.SUBJECTID = EVENT_ITEM.SUBJECTID(+)
AND FI.VISITID = EVENT_ITEM.VISITID(+)
AND FI.FORMID = EVENT_ITEM.FORMID(+)
AND FI.FORMINDEX = EVENT_ITEM.FORMINDEX(+)
Do you have the license for parallel query (may/may not help)? PQO can help with sorts ... -
How to create index to speed up query on XMLTYPE table
I have a table of XMLTYPE called gary_pass_xml. What kind of index can I create on the table to speed up this query.
SELECT (Extract(Value(FareGroupNodes),'/FareGroup')) FareGroup
FROM GARY_PASS_XML tx,
TABLE(XMLSequence(Extract(Value(tx),'/FareSearchRS/FareGroup'))) FareGroupNodes
WHERE existsnode(value(tx),'/FareSearchRS/FareGroup') = 1I have a table of XMLTYPE called gary_pass_xml. What kind of index can I create on the table to speed up this query.
SELECT (Extract(Value(FareGroupNodes),'/FareGroup')) FareGroup
FROM GARY_PASS_XML tx,
TABLE(XMLSequence(Extract(Value(tx),'/FareSearchRS/FareGroup'))) FareGroupNodes
WHERE existsnode(value(tx),'/FareSearchRS/FareGroup') = 1 -
How to speed up query retrieval
How can one speed up querty retrieval from database
Hi,
Add Index to Table.
Tunning of query.
Passing Optimiser Hint to query.
Bye
Chitta -
Virtual IP - how to speed up query result?
Hello,
I have a virtual IP. When I execute a report I receive after 5 minutes a result.
Following questions:
1. How can I detect the bottleneck?
2. Is there a "standard" way to improve the query runtime?
Thanks for input.
Best regards.
Pascal KernHi, STARWARS
Use tr RSRT -> Execute + Debub -> Mark "Display statistics data" -> Execute
Press F3 (back).
There you can see "Statistic Data for Query Runtime".
Analyze lines with long duration.
Hope it helps,
Alexander Kuzmich -
Hi,
we are implementing VOIP over internet.
Unfortunately the cisco router is taken care by ISP.
The problem is the VOIP works ok for a few days or weeks and then we have disturbances.
I performed some speed tests which show me a upload limited to 32K
the internet lease line is 256 K.but the ISP says the upload and download is 256K
All I would like to know is ..is there anything I can ask the ISP to check on their end which can help me for confirming the upload speed ?I can explain why you are getting this problem.
When you download packets of data your computer sends acknowledgments of the packets it is receiving back up the line. This is known as ACK data.
So if your upload is maxed out then there is no room for your ACK data and this will cripple your download speed.
The way to resolve this is to use traffic shaping or 'Quality of Service'QOS.
The best system would be to use a ADSL2+ router that supports QoS. Then you could set up rules to prioritise ACK data packets above any other types of outgoing data you use. If there is only 1 computer behind your adsl2+ modem that is uplaoding then you could run QoS software on your mac. Software such as throttled -
Hi,
I was wondering if anyone had any suggestions on how to improve the performance of this code? All table used are indexed. The calling routine for this procedure is set into a for loop. I am working on Oracle8i release 8.1.7.4.0.
Thanks,
Darren
CREATE OR REPLACE PACKAGE aa_mars
AS
PROCEDURE get_mars_info;
END aa_mars;
CREATE OR REPLACE PACKAGE BODY aa_mars
AS
PROCEDURE get_mars_info
IS
Variables
TYPE MPANS is TABLE OF by_recon_mpans.mpan_core%TYPE;
mpan MPANS;
lv_module_name VARCHAR2(30) := 'Populate MARS Alignment Info';
lv_sqlerrm VARCHAR2(2000) := '';
ln_sqlcode NUMBER := 0;
lv_error_text VARCHAR2(2000) := '';
vv_control VARCHAR2(20);
BEGIN
--dbms_output.put_line ('Started :'||TO_CHAR(SYSDATE,'DD/MM/YY HH24:MI:SS'));
SELECT a.mpan_core BULK COLLECT
INTO mpan
FROM by_recon_mpans a
WHERE NOT EXISTS(SELECT 1
FROM aa_mars_info b
WHERE a.mpan_core = b.mpan_core)
AND SUBSTR(a.mpan_core,1,2) IN (13,18)
AND ROWNUM < 2000;
/********** MARS DETAILS ******************************/
FORALL i in mpan.FIRST..mpan.LAST
INSERT INTO aa_mars_info
mpan_core
, reg_id
, reg_efd
, reg_etd
, meter_id
SELECT DISTINCT r.ms_mpan_core mpan_core
, r.register_channel_id reg_id
, MIN(r.effective_from_date) reg_efd
, MAX( DECODE( r.effective_to_date, TO_DATE('01-JAN-4000', 'DD-MON-YYYY'),TO_DATE('31-DEC-2999', 'DD-MON-YYYY'),r.effective_to_date)) reg_etd
, m.short_meter_id mtr_id
FROM registers@link_to_mars r
, meters@link_to_mars m
WHERE m.meter_id=r.mtr_meter_id
AND m.effective_from=r.mtr_effective_from
AND r.ms_mpan_core = mpan(i)
AND r.effective_to_date IN (SELECT MAX (r1.effective_to_date)
FROM registers@link_to_mars r1
WHERE r.ms_mpan_core = r1.ms_mpan_core)
AND r.mtr_meter_id IN (SELECT e.mtr_meter_id
FROM registers@link_to_mars e
WHERE e.ms_mpan_core=r.ms_mpan_core
AND e.effective_to_date=r.effective_to_date)
GROUP BY r.ms_mpan_core
, r.register_channel_id
, m.short_meter_id;
COMMIT;
EXCEPTION HANDLER
EXCEPTION
WHEN OTHERS THEN
lv_sqlerrm := SQLERRM;
ln_sqlcode := SQLCODE;
Tracker_Error_Handler.write_error(v_module_name => lv_module_name
,v_error_code => ln_sqlcode
,v_error_message => lv_sqlerrm
,v_additional_text => lv_error_text
,v_error_type => Dctrack_Constants.c_error_fatal);
dbms_output.put_line(lv_error_text);
ROLLBACK;
END get_mars_info;
END aa_mars;
/We only have read access on the database over the link. A view can be read only. I know, I know, what you mean is you aren't allowed to put additional objects on the remote database. Still I suggest you ask: it's it their interest to make your query as efficient as possible too, because they are the ones serving you the data, so it's dragging their system down too.
... without me having to copy all the tables to a local area?Well, that's what you're effectively doing anyway at the moment.
Do you have any further suggestions, Yes, use the LIMIT caluse in the bulk collect.
-- decalration section
CURSORC c_mpans IS
SELECT a.mpan_core
FROM by_recon_mpans a
WHERE NOT EXISTS(SELECT 1
FROM aa_mars_info b
WHERE a.mpan_core = b.mpan_core)
AND SUBSTR(a.mpan_core,1,2) IN (13,18);
BEGIN
OPEN c_mpans;
LOOP
FETCH c_mpans BULK COLLECT INTO mpan LIMIT 2000;
EXIT WHEN mpan.count() = 0;
FORALL i IN mpan.FIRST..mpan.LAST
END LOOP;
END;
/At least then you only call the procedure once and execute the main query once.
Cheers, APC -
I am using an Oracle 8i database.
I have a table with 35 000 000 records.
I created a query (this query is eventually going to be used to insert records into a table) using two indexed fields in the where clause to join another table. The query starts returning values in PL/SQL Developer within 2 seconds. I then add another criteria in the where clause and I restrict values to a specific date ie. trunc(transaction_date) = ’01-SEP-2010’. The query returns 100 rows and hangs for a few minutes before returning another 100 rows. There are no indexes on transaction_date and I cannot build indexes on transaction date as I am truncating the field. At a later stage I may even use the transaction date to return values for a specific month and year ie.
To_char(transaction_date,MMYYYY’).
Are there any other way of using transaction date and not having a performance issue?781424 wrote:
I am using an Oracle 8i database.
I have a table with 35 000 000 records.
I created a query (this query is eventually going to be used to insert records into a table) using two indexed fields in the where clause to join another table. The query starts returning values in PL/SQL Developer within 2 seconds. I then add another criteria in the where clause and I restrict values to a specific date ie. trunc(transaction_date) = ’01-SEP-2010’. The query returns 100 rows and hangs for a few minutes before returning another 100 rows. There are no indexes on transaction_date and I cannot build indexes on transaction date as I am truncating the field. At a later stage I may even use the transaction date to return values for a specific month and year ie.
To_char(transaction_date,MMYYYY’).
Are there any other way of using transaction date and not having a performance issue?This is wrong:
trunc(transaction_date) = ’01-SEP-2010’as you should treat dates as dates...
trunc(transaction_date) = to_date('01-SEP-2010','DD-MON-YYYY')Also...
There are no indexes on transaction_date and I cannot build indexes on transaction date as I am truncating the fieldYes you can, you can build a function based index...
CREATE INDEX idx_tr_date ON mytable (trunc(transaction_date));You can also create indexes for the year or months as required.
Also consider partitioned tables if you are licenced for them as you can partition on the years and months etc. -
Speed Checker Query & FTTC for Stamford Exchange
Couple of queries, here goes.
I live in Ryhall which is attached to the Stamford exchange, hence the line attenuation is pretty high at 63dB. I've had a fixed rate 1Mbps service on this line for a few years now and after a few tweaks been rock solid. My old Belkin router used to report a Signal Margin of ~12dB, this has now been replaced by a 2Wire unit and the Signal Margin has now improved to 20dB. Interestingly, the Speed Checker on SamKnows has changed its readings to say a fixed 2Mbps is now available (previously a X) and ADSL2+ now 3Mbps. Is this because of the new router and would these rates be achievable in the real world?
FTTC RFS date is now set for the Stamford exchange 01/03/2011 would this include the cabinets in Ryhall?
Thanks, OzzWelcome Darren,
Bt Total Broadband is a rate adaptive product, and for new lines a period of line training needs to take place.
The training can last up to 10 days, and during that time no assumptions can be made as to the performance of the line, as various line configurations and speed will be applied by the exchange dslam.
Only at the end of training will you get a true picture.
It's important to leave the hub/router connected 24/7 with no manual resets during this period, so that a line solution can be applied and associated IP profile and SNRm then set.
At times the dslam will drop the connection, as part of the training, all normal.
If after the training period the connection is poor, then effort can be applied to investigate any line and noise issues.
If you think your line training is finished, then post your hub stats, and a BT speed test and the line connection can be evaluated.
Hope this helps -
Dear all,
If i want to select data from the table that without index.
whice statement that i should be used for the better speed between
"select * from table" or "select count(*) from table" ?
Thanks for advance
CharaExcept the different result, a test is easy :
SQL> ed
Wrote file afiedt.buf
1 begin
2 for i in 1..100000 loop
3 insert into ct values (i);
4 end loop;
5* end;
6 /
PL/SQL procedure successfully completed.
SQL> set timi on
SQL> set autot traceonly explain stat
SQL> select count(*) from ct;
Elapsed: 00:00:00.00
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE
1 0 SORT (AGGREGATE)
2 1 TABLE ACCESS (FULL) OF 'CT'
Statistics
0 recursive calls
0 db block gets
156 consistent gets
0 physical reads
0 redo size
406 bytes sent via SQL*Net to client
499 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
SQL> select * from ct;
100000 rows selected.
Elapsed: 00:00:01.00
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE
1 0 TABLE ACCESS (FULL) OF 'CT'
Statistics
0 recursive calls
0 db block gets
6823 consistent gets
0 physical reads
0 redo size
1415959 bytes sent via SQL*Net to client
73825 bytes received via SQL*Net from client
6668 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
100000 rows processed
SQL> Nicolas. -
P35 Neo Questions about USB boot speed (New query)
i see it's an old topic but i have the same problem with slow USB Boot on a MSI P35 Neo2-FR mainboard.
i have tried something like 5 different USB drives and all are the same. the problem is when it's tring to boot from USB. there is some missing support for USB booting from BIOS , i don't know.
i had a BIOS from 2008 and i have updated to the latest version but nothing solved my problem.
i have tried to boot from USB with a linux live environment, windows live CD or i have tried to install windows from USB drive. all of them with very slow reading (instead of max 2-3 min loading time it takes almost 20-25min at least..).
when the system (windows) loads up the speed of reading the USB drives increse dramatically and all things gets back to normal.
with the same USB drive on several computers all the above works without any delay or very slow reading. so this i think it's the motherboard or the motherboard BIOS but i don't have a clue on how to fix this issue.
any help will be more than appreciated. thank you.AngelTudorache please read the Forum Rules and don't resurrect nearly 4 year old threads. >>Please read and comply with the Forum Rules.<<
Please post your full system specs >>Posting Guide<<
Do you use the case USB ports or the MB USB ports ? Have you tested the MB USB ports by disconnecting the case USB headers ?
Suggest you transfer a large file from the HDD to a USB device or from a USB device to the HDD and monitor the transfer speeds. Anything between 15 and 30mb/s is normal for USB2. -
Speed up SQL Query performance
Hi,
I am having a SQL query which has got some inner joins between tables.
In this query i will be selecting values from set of values obtained by going through all rows in a table.
I am using a inner join between two tables to achive this purpose.
But, as the table which i go through all rows is extremely big it takes lot of time to go through all rows and the query slows down.
Is there any other way by which i can speed up query.This is the out put of my test plan.
Please suggest which one needs to be improved.
PLAN_TABLE_OUTPUT
Plan hash value: 3453987661
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 3 | 1002 | 3920 (1)| 00:00:48 |
| 1 | SORT ORDER BY | | 3 | 1002 | 3920 (1)| 00:00:48 |
|* 2 | TABLE ACCESS BY INDEX ROWID | AS_EVENT_CHR_DATA | 1 | 17 | 4 (0)| 00:00:01 |
| 3 | NESTED LOOPS | | 3 | 1002 | 3919 (1)| 00:00:48 |
|* 4 | HASH JOIN | | 3 | 951 | 3907 (1)| 00:00:47 |
|* 5 | TABLE ACCESS FULL | EV_CHR_DATA_TYPE | 1 | 46 | 2 (0)| 00:00:01 |
| 6 | TABLE ACCESS BY INDEX ROWID | AS_EVENT_CHR_DATA | 702 | 50544 | 3883 (1)| 00:00:47 |
| 7 | NESTED LOOPS | | 348 | 94308 | 3904 (1)| 00:00:47 |
| 8 | NESTED LOOPS | | 1 | 199 | 21 (5)| 00:00:01 |
| 9 | NESTED LOOPS | | 1 | 174 | 20 (5)| 00:00:01 |
|* 10 | HASH JOIN | | 1 | 127 | 18 (6)| 00:00:01 |
| 11 | NESTED LOOPS | | 1 | 95 | 13 (0)| 00:00:01 |
| 12 | NESTED LOOPS | | 1 | 60 | 12 (0)| 00:00:01 |
| 13 | NESTED LOOPS | | 1 | 33 | 10 (0)| 00:00:01 |
| 14 | TABLE ACCESS BY INDEX ROWID| ASSET | 1 | 21 | 2 (0)| 00:00:01 |
|* 15 | INDEX UNIQUE SCAN | SERIAL_NUMBER_K3 | 1 | | 1 (0)| 00:00:01 |
|* 16 | INDEX FAST FULL SCAN | SYS_C0053318 | 1 | 12 | 8 (0)| 00:00:01 |
| 17 | TABLE ACCESS BY INDEX ROWID | SEGMENT_CHILD | 1 | 27 | 2 (0)| 00:00:01 |
|* 18 | INDEX RANGE SCAN | SYS_C0053319 | 12 | | 1 (0)| 00:00:01 |
| 19 | TABLE ACCESS BY INDEX ROWID | SEGMENT | 1 | 35 | 1 (0)| 00:00:01 |
|* 20 | INDEX UNIQUE SCAN | SYS_C0053318 | 1 | | 0 (0)| 00:00:01 |
|* 21 | TABLE ACCESS FULL | SEGMENT_TYPE | 1 | 32 | 4 (0)| 00:00:01 |
| 22 | TABLE ACCESS BY INDEX ROWID | ASSET_ON_SEGMENT | 1 | 47 | 2 (0)| 00:00:01 |
|* 23 | INDEX RANGE SCAN | ASSET_ON_SEGME_UK8115533871153 | 1 | | 1 (0)| 00:00:01 |
| 24 | TABLE ACCESS BY INDEX ROWID | ASSET | 1 | 25 | 1 (0)| 00:00:01 |
|* 25 | INDEX UNIQUE SCAN | SYS_C0053240 | 1 | | 0 (0)| 00:00:01 |
|* 26 | INDEX RANGE SCAN | AS_EV_CHR_DATA_ASSETPK | 4673 | | 28 (4)| 00:00:01 |
|* 27 | INDEX RANGE SCAN | SYS_C0053249 | 5 | | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - filter("PARAMETRIC_TAG_NAME"."DATA_VALUE"='EngineOilConsumption')
4 - access("AS_EVENT_CHR_DATA"."EC_DB_SITE"="EV_CHR_DATA_TYPE"."EC_DB_SITE" AND
"AS_EVENT_CHR_DATA"."EC_DB_ID"="EV_CHR_DATA_TYPE"."EC_DB_ID" AND
"AS_EVENT_CHR_DATA"."EC_TYPE_CODE"="EV_CHR_DATA_TYPE"."EC_TYPE_CODE")
5 - filter("EV_CHR_DATA_TYPE"."NAME"='servicing ptric time unit')
10 - access("OILSEG"."SG_TYPE_CODE"="SEGMENT_TYPE"."SG_TYPE_CODE")
15 - access("ASSET"."SERIAL_NUMBER"='30870')
16 - filter("ASSET"."ASSET_ID"="SEGMENT"."SEGMENT_ID")
18 - access("SEGMENT"."SEGMENT_SITE"="SEGMENT_CHILD"."SEGMENT_SITE" AND
"SEGMENT"."SEGMENT_ID"="SEGMENT_CHILD"."SEGMENT_ID")
20 - access("SEGMENT_CHILD"."CHILD_SG_SITE"="OILSEG"."SEGMENT_SITE" AND
"SEGMENT_CHILD"."CHILD_SG_ID"="OILSEG"."SEGMENT_ID")
21 - filter("SEGMENT_TYPE"."NAME"='Aircraft Equipment Engine Holder')
23 - access("OILSEG"."SEGMENT_ID"="ASSET_ON_SEGMENT"."SEGMENT_ID")
25 - access("ASSET_ON_SEGMENT"."ASSET_ORG_SITE"="OILASSET"."ASSET_ORG_SITE" AND
"ASSET_ON_SEGMENT"."ASSET_ID"="OILASSET"."ASSET_ID")
26 - access("ASSET_ON_SEGMENT"."ASSET_ORG_SITE"="AS_EVENT_CHR_DATA"."ASSET_ORG_SITE" AND
"ASSET_ON_SEGMENT"."ASSET_ID"="AS_EVENT_CHR_DATA"."ASSET_ID")
27 - access("AS_EVENT_CHR_DATA"."AS_EV_ID"="PARAMETRIC_TAG_NAME"."AS_EV_ID") -
i was wondering if anyone has any ideas on how to speed this query up
SELECT NAME, trunc (opr_date + opr_hour/24-numtodsinterval(1,'second'), 'DDD') AS opr_date, PRICE,
Case OPR_HOUR When 0 THEN 24 ELSE OPR_HOUR END AS OPR_HOUR
FROM ze_data.pjm_edf_lmp_hourly_int
WHERE trunc (opr_date + opr_hour/24-numtodsinterval(1,'second'), 'DDD') between to_date ('2010/07/26', 'yyyy/mm/dd') and to_date ('2010/07/28', 'yyyy/mm/dd') and NAME in ('MISO')
ORDER BY OPR_DATE desc, opr_hour descThe data is stored in the database with hours 0 to 23 this code take hour 0 and switches it to hour 24 of the the day before. I was wondering if there was a way to speed up the query as it takes 8 seconds to run
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0Since you're comparing OPR_DATE to a date range, is there any need to add the time to OPR_DATE?
Would this work better? An index on OPR_DATE might help, but wouldn't an index on NAME be even better?
I don't know, just a guess. You haven't posted anything we can use.
SELECT NAME
,trunc (opr_date + opr_hour/24-numtodsinterval(1,'second'), 'DDD') AS opr_date
,PRICE
,Case OPR_HOUR When 0 THEN 24 ELSE OPR_HOUR END AS OPR_HOUR
FROM ze_data.pjm_edf_lmp_hourly_int
WHERE opr_date >= to_date ('2010/07/26', 'yyyy/mm/dd')
and opr_date <= to_date ('2010/07/28', 'yyyy/mm/dd')
and NAME in ('MISO')
ORDER BY OPR_DATE desc, opr_hour desc; -
How to speed up a query?
I want to select the MM generated documents from BKPF table where the awkey = MM Invoice no + FY and the awtyp = "RMRP". However since the BKPF table is very huge it takes a lot of time to execute.
Hence i would like to know if there is any other faster way to speed this query?Hi ,
Following points will help to improve performance.
1. Creation of secondary index with the fields you are using in select query.You need to do runtime anaysis and trace analysis to view the impact of this.
2. Try to minimize number of hits to the database table.Get the desired records from table in one go.
3. Try to minimize the records fetched from the table.You can achive this by making some fields on screen as mandatory and using them in where condition of select statement.
Hope this helps you.
Maybe you are looking for
-
Reg: ALV (REUSE_ALV_GRID_DISPLAY)
Hi Experts, I need to know how to give drop down list in one of the field in my ALV. I found some posting in sdn, but that are related to OOPS concepts. But i am using REUSE function module. Can you please provide me the solution how to achecive drop
-
Can the Apple TV 3rd generation be played through a Danon receiver or is the only option to plug directly into the tv?
-
Popup message 'Export In Progress' during export creation.
Hello, Having problems closing a popup window which displays "Export in Progress" after my code creates the file and before I set response.setContentType and the Content-Disposition header (trying to close after is pointless). The problem is I can't
-
I have added a pie chart to a page with about 14 diffirent categories. The problem is that the label overlaoe each ther for that category whose data is relativley less then other category e.g cat1 2 cat2 100 cat3 200 So the label of cat1 will overlap
-
Organizational Responsibility in SRM 5.00
Hello SRM experts Apologies if this is an elementary question. We are setting up purchasers to be responsible for certain categories through the Responsibility tab in PPOMA_BBP. Then we are assigning which locations they are responsible for beneath.