How to make xmlType query faster..
Hello,
How do I make queries with extract in where clause faster. I do have a function based index on my xml_data column but even then the query takes a long time to
execute.
CREATE INDEX merch_id_idx ON xmltest
(xml_data.extract('//MERCHANT_ID/text()').getStringVal());
select *
from xmltest e
where e.xml_data.extract('//MERCHANT_ID/text()').getStringVal()= 'G000000002680'
Thanks,
Anna
Hi Anna,
Can you produce an explain plan for the query and show whether it is using the index or not? How many rows of data are you dealing with and how long is it taking to execute?
Similar Messages
-
How to make slow reports fast?
Hi all,
How to make slow reports fast? What could be the various reasons and optimizations/solutions?
Thanks,
Charles.
++++++++++++++++++++++++++++++Its an on going process. Couple of steps you will have to follow: Did you perform any SQL trace ..?
Did you perform any ABAP trace...?
How much business data these reports are processing.Is there a possibility you can do some changes.
SQL Trace ( SAP in built tool) will give you a fair idea about each and every SQL statements in your report. And you can anlyze bad ones. And also propse optimized SQL or
index if needed.
ABAP Trace(SAP in bulit tool), you can find out amount of ABAP run time thats being elapsed by each and individual abap module.
Also the amount of business data is every important. While designing the report alogorithm this is very important factor. -
How to make af: query (ResultComponentId) has two target values?
hello all :D
i'm newbie in jdev, i have little problem with af:query.
how to make af: query (ResultComponentId) has two target values?
thx
agungdmt :DI think you can simply set the second target control's partialTrigger to the af:query.
and access to the same binding attribute as your first target. (e.g.: if you have 2 target tables, set the value to #{bindings.XxxxxVO1.collectionModel})
Samson Fu -
How to make a query to list out Journal voucher that hasn't been posted
Hi, do you know how to make a query to list out Journal voucher that hasn't been posted?
By what code name identify that?
Thanks.
Raymond
Edited by: Rui Pereira on Aug 6, 2008 3:57 PMjack,
there is no link with OBTD to OJDT and JDT1.
voucher number in obdt is different,
after posting voucher is saved as journal entry seperate
number is generated.
you can link OACT,OCRD WITH OJDT,JDT1.
Jeyakanthan -
How to make materialized view fast refresh parallel
We have Oracle 11.2.0.1 on Redhat 5.2. We use a dozen of fast refresh materialized views in our application.
From time to time MV refresh takes longer time than the refresh interval.
One of way to improve performance of MV refresh is to make the refresh parallel, e.g. http://www.dba-oracle.com/t_materialized_views_refreshing_performance.htm
- Use parallel DML - Oracle author Michael Armstrong Smith notes "I've done parallel materialized view refreshing
on tables recently and improved the load times considerably. Rather than having one load which took 2 hours,
I run 4 parallel loads, one for each partition. The length of time for the whole process is now determined by
how long the biggest partition takes to load. In my case, this is 40 minutes, with two 30 minute loads and one
20 minute load. Overall I am saving 1 hour 20 minutes. I can now add further partitions and do the same thing.
My only limitation is the parallel loads because I don't have unlimited processing power.
{code} My master tables are not partitioned, but think parallel will still better than non-parallel.
Now the question, how to make refresh parallel. According to the paragraph cited above, Use parallel DML appears doing the job. Can someone confirm that.
We use {code}
alter materialied view MV_OFFENSE parallel REFRESH FAST start with sysdate next sysdate+ 1/24;
{code}to schedule refresh. Does the parallel clause here parallels query the MV or refresh the MV?
Any other way to make MV refresh parallel?
ThanksDoc http://download.oracle.com/docs/cd/E11882_01/server.112/e16579/refresh.htm#i1006319 says:
>
In a data warehousing environment, assuming that the materialized view has a parallel clause, the following sequence of steps is recommended:
1.
Bulk load into the fact table
2.
Enable parallel DML
3.
An ALTER SESSION ENABLE PARALLEL DML statement
4.
Refresh the materialized view -
How to make the search faster in a table ?
hi ,
i have got a table wich has one field as a primary key , and this table got 500000 records in it
wich i try to pop up the (LOV) it takes about one minute to be retreived
i dodnt know how to make it faster ?
could anyone help me how to make faster ?
and what index should i put on this table ?thanks for your help
and here is the the
CREATE TABLE MOBWORKSHOP.MOBWSH_GUARANTY
GRNTY_NO VARCHAR2(10 BYTE),
I_CODE VARCHAR2(30 BYTE),
SERIAL_NO VARCHAR2(30 BYTE) NOT NULL,
GRNTY_START_DATE DATE,
GRNTY_EXPIR_DATE DATE,
GRNTY_VALIDTY NUMBER(1),
CAUSE_ID VARCHAR2(10 BYTE),
NOTE VARCHAR2(60 BYTE),
AD_U_ID NUMBER(5) NOT NULL,
AD_DATE DATE NOT NULL,
UP_U_ID NUMBER(5),
UP_DATE DATE,
BRN_NO NUMBER(6) NOT NULL,
BRN_YEAR NUMBER(4)
TABLESPACE MOBWRKSHPTRANS
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
CREATE UNIQUE INDEX MOBWORKSHOP.MOBWSH_GUARANTY_PK ON MOBWORKSHOP.MOBWSH_GUARANTY
(GRNTY_NO)
LOGGING
TABLESPACE INDX_TRANS_MOBWRKSHP
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
NOPARALLEL;
ALTER TABLE MOBWORKSHOP.MOBWSH_GUARANTY ADD (
CONSTRAINT MOBWSH_GUARANTY_PK
PRIMARY KEY
(GRNTY_NO)
USING INDEX
TABLESPACE INDX_TRANS_MOBWRKSHP
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
ALTER TABLE MOBWORKSHOP.MOBWSH_GUARANTY ADD (
CONSTRAINT MOBWSH_QRNTY_I_CODE_FK
FOREIGN KEY (I_CODE)
REFERENCES MOBWORKSHOP.ITEM_DETAILS (I_CODE),
CONSTRAINT MOBWSH_CANCEL_CAUS_FK
FOREIGN KEY (CAUSE_ID)
REFERENCES MOBWORKSHOP.GUARANTY_CANCEL_CAUSES (CAUSE_ID));
i made a button to show (LOV) and when i press the putton it take about one minute to view the LOV -
How to make download spped fast?
Having problem with download speed. We rented a movie and itunes estimates over 1000 min. We had 100mb/sec connection. How we can make the download faster?
Its an on going process. Couple of steps you will have to follow: Did you perform any SQL trace ..?
Did you perform any ABAP trace...?
How much business data these reports are processing.Is there a possibility you can do some changes.
SQL Trace ( SAP in built tool) will give you a fair idea about each and every SQL statements in your report. And you can anlyze bad ones. And also propse optimized SQL or
index if needed.
ABAP Trace(SAP in bulit tool), you can find out amount of ABAP run time thats being elapsed by each and individual abap module.
Also the amount of business data is every important. While designing the report alogorithm this is very important factor. -
How to make linkage query In Data Model for search
I want to make an linkage query as a condition for my report in BI Publisher. how to make the linkage in Date Model ?
This is the forum for SQL Developer, not for general SQL or PL/SQL questions.
Please repost this in the SQL and PL/SQL forum. -
How to make my program faster?
I have a program which produces two elements array. In normally the program ends in microseconds, however when I organize my program to send the array as a data to DAQ.mx write and the array will be the voltage output from my NI USB-6012 DAQ, my program ens in 40 seconds. How can I make my program faster? Is there any solution?
I have attached the normal program and with DAQ.vis.
Attachments:
step step 1.vi 15 KB
step step 2.vi 34 KBProgram 1 runs 5 times and program 2 runs 41 times per loop. the total number of inner iterations is 25 vs. 1681 for a 67x difference.
Program 1 and program 2 have no timing information, thus spin at a undefined rate.
Program 2 does single point hardware IO and also has no timing information. The speed will depend on the hardware.
Running at a hardware dependent rate is not a good idea in general, because the speed will vary with every change in hardware and is not deterministic. You don't even know what occurs first at each iteration: the input or the output.
If speed is important, what you should do is use an improved variation (Yes, use FOR loops and ramps!) of program 1 to generate the final data array, then do a single "Nchan,Nsamp" IO, running input and output synchronized hardware timed off the same clock. This way you can select any acquisition speed up the the maximum supported by your DAQ hardware. It will be fast and at an exactly defined rate as it should be!
Try it!
I am not familiar with your hardware: USB-6012. can you give a link to the product page?
LabVIEW Champion . Do more with less code and in less time . -
How To Make Search Query Showing the Result As List of Buttons.
Can some one give me an idea how to start to make a Search Query showing the results as list of buttons.. i have already have my buttons with names. i just dont know how to make a search query.
this is my on screen keyboard i made..
im making a system that the result were a list of buttons.. showing like this
This was supposed to be the output of the query that i need to do..
Please help me.. i just need a idea or tips how to make this one.Here is code I posted recently for another question
Public Class Form1
Const BUTTON_SIZE As Integer = 20
Const SPACE As Integer = 5
Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
Dim buttons As New List(Of List(Of MyRadioButton))
For row = 1 To 6
Dim newRow As New List(Of MyRadioButton)
buttons.Add(newRow)
For col = 1 To 6
Dim button As New MyRadioButton()
button.row = row
button.col = col
button.Height = BUTTON_SIZE
button.Width = BUTTON_SIZE
button.Left = col * (BUTTON_SIZE + SPACE)
button.Top = row * (BUTTON_SIZE + SPACE)
button.Name = String.Format("radGr1{0}_{1}", row.ToString(), col.ToString())
Me.Controls.Add(button)
newRow.Add(button)
AddHandler button.CheckedChanged, AddressOf Radio_Change
Next col
Next row
End Sub
Private Sub Radio_Change(ByVal sender As Object, ByVal e As System.EventArgs)
Dim button As MyRadioButton = CType(sender, MyRadioButton)
Dim row As Integer = button.row
Dim col As Integer = button.col
End Sub
End Class
Public Class MyRadioButton
Inherits RadioButton
Public row As Integer
Public col As Integer
End Class
jdweng -
Does Anybody Know how to make Safari 3 Faster?
Does Anybody Know how to make Safari 3 a little bit faster for WIndows?
Come on does anybody know plzz?
-
How to make dynamic query using DBMS_SQL variable column names
First of all i will show a working example of what i intend to do with "EXECUTE IMMEDIATE":
(EXECUTE IMMEDIATE has 32654 Bytes limit, which isn't enough for me so i'm exploring other methods such as DBMS_SQL)
-------------------------------------------------CODE-----------------------------------
create or replace PROCEDURE get_dinamic_query_content
(query_sql IN VARCHAR2, --any valid sql query ('SELECT name, age FROM table')
list_fields IN VARCHAR2) --list of the columns name belonging to the query ( arr_list(1):='name'; arr_list(2):='age';
-- FOR k IN 1..arr_list.count LOOP
-- list_fields := list_fields || '||content.'||arr_list(k)||'||'||'''~cs~'''; )
AS
sql_stmt varchar (30000);
BEGIN
sql_stmt :=
'DECLARE
counter NUMBER:=0;
auxcontent VARCHAR2(30000);
CURSOR content_cursor IS '|| query_sql ||';
content content_cursor%rowtype;
Begin
open content_cursor;
loop
fetch content_cursor into content;
exit when content_cursor%notfound;
begin
auxcontent := auxcontent || '||list_fields||';
end;
counter:=counter+1;
end loop;
close content_cursor;
htp.prn(auxcontent);
END;';
EXECUTE IMMEDIATE sql_stmt;
END;
-------------------------------------------------CODE-----------------------------------
I'm attepting to use DBMS_SQL to perform similar instructions.
Is it possible?Hi Pedro
You need to use DBMS_SQL here because you don't know how many columns your query is going to have before runtime. There are functions in DBMS_SQL to get information about the columns in your query - all this does is get the name.
SQL> CREATE OR REPLACE PROCEDURE get_query_cols(query_in IN VARCHAR2) AS
2 cur PLS_INTEGER;
3 numcols NUMBER;
4 col_desc_table dbms_sql.desc_tab;
5 BEGIN
6 cur := dbms_sql.open_cursor;
7 dbms_sql.parse(cur
8 ,query_in
9 ,dbms_sql.native);
10 dbms_sql.describe_columns(cur
11 ,numcols
12 ,col_desc_table);
13 FOR ix IN col_desc_table.FIRST .. col_desc_table.LAST LOOP
14 dbms_output.put_line('Column ' || ix || ' is ' ||
15 col_desc_table(ix).col_name);
16 END LOOP;
17 dbms_sql.close_cursor(cur);
18 END;
19 /
Procedure created.
SQL> exec get_query_cols('SELECT * FROM DUAL');
Column 1 is DUMMY
PL/SQL procedure successfully completed.
SQL> exec get_query_cols('SELECT table_name, num_rows FROM user_tables');
Column 1 is TABLE_NAME
Column 2 is NUM_ROWS
PL/SQL procedure successfully completed.
SQL> exec get_query_cols('SELECT column_name, data_type, low_value, high_value FROM user_tab_cols');
Column 1 is COLUMN_NAME
Column 2 is DATA_TYPE
Column 3 is LOW_VALUE
Column 4 is HIGH_VALUE
PL/SQL procedure successfully completed.I've just written this as a procedure that prints out the column names using dbms_output - I guess you're going to do something different with the result - maybe returning a collection, which you'll then parse through in Apex and print the output on the screen - this is just to illustrate the use of dbms_sql.
best regards
Andrew
UK -
hi,
i have 2 tables emp1 & emp2
emp1 consist
empno month amt
001 201002 200
001 201003 100
emp2 consist
empno month amt
001 201001 100
001 201002 200
001 201003 100
i want to make a query on emp1 table where i want to show amt according to month ,if data is not available in emp1 table then only then it should take data from emp2 table ,if emp2 has that month data o/w 0.
my output should be like this
empno month amt
001 201001 100
001 201002 200
001 201003 100
regardsMay be....
SQL> WITH emp1 AS (SELECT '001' empno,'201002' mon,200 amt FROM DUAL UNION ALL
2 SELECT '001' empno,'201003' mon,100 amt FROM DUAL
3 )
4 ,emp2 AS ( SELECT '001' empno,'201001' mon,100 amt FROM DUAL UNION ALL
5 SELECT '001' empno,'201002' mon,200 amt FROM DUAL UNION ALL
6 SELECT '001' empno,'201003' mon,100 amt FROM DUAL
7 )
8 SELECT coalesce(e1.empno,e2.empno) empno,
9 coalesce(e1.mon,e2.mon) mon,
10 coalesce(e1.amt,e2.amt)amt
11 FROM emp1 e1 FULL OUTER JOIN emp2 e2
12 ON e1.empno =e2.empno
13 AND e1.mon=e2.mon
14 ORDER BY 2 ;
EMP MON AMT
001 201001 100
001 201002 200
001 201003 100 -
How do make this query ?
CREATE TABLE CLIENT (
CLIENTID NUMBER PRIMARY KEY,
NAME VARCHAR2(40)
CREATE TABLE SALESMAN (
SALESMANID NUMBER PRIMARY KEY,
NAME VARCHAR2(40),
ALL_CLIENTS NUMBER -- ACCESS ALL CLIENTS IF VALUE IS 1
CREATE TABLE CLIENTSALESMAN (
SALESMANID NUMBER,
CLIENTID NUMBER
INSERT INTO CLIENT VALUES(1,'Bob');
INSERT INTO CLIENT VALUES(2,'Jhon');
INSERT INTO CLIENT VALUES(3,'Robert');
INSERT INTO CLIENT VALUES(4,'Clarck');
INSERT INTO SALESMAN VALUES (1,'Christina',0);
INSERT INTO SALESMAN VALUES (2,'Doug',1); -- access all clients
INSERT INTO CLIENTSALESMAN VALUES (1,1);
INSERT INTO CLIENTSALESMAN VALUES (1,2);
How do you return all the clients of a salesman ? same that SALESMAN.ALL = 1 OR SALESMAN.ALL = 0.
the salesman.all is 1 then he access all clients no need insert in CLIENTSALESMAN. If SALESMAN.ALL = 0 he
access clientsalesman.
Does somebody some suggestion how i make this ?
thanks !1 select *
2 from (select a.name SALESMAN, b.name CLIENT
3 from salesman a, client b, clientsalesman
4 where a.SALESMANID = c.SALESMANID
5 and b.CLIENTID = c.CLIENTID
6 union
7 select a.name SALESMAN, b.name CLIENT
8 from salesman a, client b
9 where a.ALL_CLIENTS = 1)
10* where salesman = '&1'
SQL> /
Enter value for 1: Christina
old 10: where salesman = '&1'
new 10: where salesman = 'Christina'
Christina Bob
Christina Jhon
SQL> /
Enter value for 1: Doug
old 10: where salesman = '&1'
new 10: where salesman = 'Doug'
Doug Bob
Doug Clarck
Doug Jhon
Doug RobertNicolas. -
How to make this query go faster
Hi ,
I have the following query :
select a.* from
tbl1 a , tbl2 b
where a.id = b.id
substr(b.id , 3, 2) <> 'XX'
and b.date1 is not null
and b.date1 >= sysdate - 90 ;
tbl1 - 21 million rows
tbl2 - 2 millions
i specify this hints /*+ INDEX(idxa_1 , idxa_2) INDEX(ixdb_1)
where idxa_1 --> b.lotid
idxa_2 --> b.date1
idxb_1 --> a.lotid
IF i DO NOT include b.date1 is not null and b.date1 >= sysdate - 90 ,
from explain plan i could see it using a FAST FULL SCAN which really returns very fast
HOWEVER if i include b.date1 is not null and b.date1 >= sysdate - 90
, from explain plain it uses row index and then there's a range scan and its slow
how can i improve the performance of this query ?
pls advise
tks & rdgsDon't create the temporary table.
Create a function based index on table two
substr(id , 3, 2)Make sure you have gathered statistics on the tables.
Remove the hint.
select a.* from
tbl1 a , tbl2 b
where a.id = b.id
and substr(b.id , 3, 2) <> 'XX'
and b.date1 >= sysdate - 90;If you still have performance problems, post the formatted explain plan from sqlplus.
Read the Performance Tuning Guide.
Unfortunately this is not urs advice.
Maybe you are looking for
-
The app shows the download bar at the bottom but nothing is happening. My app button is also grayed out.
-
OS X freezes when on loading screen
I was listening to iTunes and OS X crashed and I had to restart my computer. i opened it again and it crashed my computer again. Then after i restarted i decided to not mess with iTunes and try photoshop, that crashed my computer i had to restart and
-
Does K9N6SGM-V can run an AM3 cpu?
Hi guys, I have this motherboard: http://www.msi.com/index.php?func=proddesc&maincat_no=1&prod_no=1086 and now it has an AM2 Sempron on it. I see on the list of supported CPUs that there are no AM3 cpus, but I know that MSI doesn't update those lists
-
How do I import document from my desk top into pages on my ipad?
How do I import document from my desk top into pages on my ipad?
-
Getting error while opening Workbook
hi Gurus, In the production system I am getting error while opening the workbook 'THE WORKBOOK DOESNOT EXISTS IN THE DOCUMENT STORES' through analyzer, transported successfully. Even single workbook not able open, even I am able to open th