Problems of performance with a PL/SQL Tables

Hello

We have a .net application which connects to our Oracle (10.2.0.3) database to extract and load data. In most cases, an array of the keys is passed to a procedure, in which we open a Ref cursor and even return to the application to read the data.
For the array of keys being passed to the procedure, make us a cast and transform it into a table in our query. For example, below takes about 15-18 seconds when we TABLE table table MELTING / nested. If I change the table and insert object keys straight into an "IN" clause he finishes in 1-2 seconds.
We have the latest statistics on all tables used.

Why convert the a PLSQL, using the CAST TABLE table table bearing on execution plan so much?
Is there another solution to this problem?

Queries and their execution plans are given below (I put in literal values for my tests rather than specify the table).
Query 1: (WITH the TYPE CAST)*.
SELECT '1'
OF quote_underlying_lbl as
quote_underlying_p qu_p
inst_fra_lbl fra
inst_fra_p fra_p
(SELECT qi.object_key as key, ID qi.quote_underlying_id
qi.version_id version, i.category as category
, qi.currency_cd as currency, i.floating_rate_index_id
Floating_rate_index I have
quote_underlying qi
floating_rate_index_p i_p
quote_underlying_p qi_p
WHERE i.quote_underlying_id = qi.quote_underlying_id
AND i_p.floating_rate_index_id = i.floating_rate_index_id
AND i_p.version_id = i.version_id
AND i_p.label_id = 26217
AND qi_p.quote_underlying_id = qi.quote_underlying_id
AND qi_p.version_id = qi.version_id
AND qi_p.label_id = 26217
) Fri
-WHERE qu.object_key IN (SELECT k.column_value FROM TABLE (CAST * (: l_qu_key_Arr AS STRING2_ARRAY_CT)) * k)
WHERE qu.object_key IN (SELECT k.column_value FROM TABLE (CAST (STRING2_ARRAY_CT)
"xyz."
"xyz1"
"xyz2."
"xyz3,"
'xyz4 '.
() AS STRING2_ARRAY_CT)) k
)
AND qu.quote_underlying_id = fra.quote_underlying_id
AND qu.quote_underlying_type_cd = "FRA".
AND qu_p.quote_underlying_id = qu.quote_underlying_id
AND qu_p.version_id = qu.version_id
AND qu_p.label_id = 26217
AND qu.quote_underlying_id = fra.quote_underlying_id
AND fra.inst_fra_id = fra_p.inst_fra_id
AND fra.version_id = fra_p.version_id
AND fra_p.label_id = 26217
-Filter FRI
AND fra.floating_rate_index_key = fri.key (+);

--------------------------------------------------------------------------------------------------------------------------------------
| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |
--------------------------------------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | 1. 222. 2378 (3) | 00:00:29 |
|* 1 | HASH JOIN RIGHT SEMI | 1. 222. 2378 (3) | 00:00:29 |
| 2. COLLECTION ITERATOR CONSTRUCTOR FETCH |
|* 3 | EXTERNAL RIGHT HASH JOIN | 3864 | 830K | 2353 (3) | 00:00:29 |
| 4. VIEW | 1. 61. 6 (0). 00:00:01 |
| 5. NESTED LOOPS | 1. 117. 9 (0) | 00:00:01 |
| 6. NESTED LOOPS | 2. 198. 7 (0) | 00:00:01 |
| 7. NESTED LOOPS | 1. 25. 3 (0) | 00:00:01 |
| 8. RANGE OF PARTITION ALL THE | 187. 2244 | 3 (0) | 00:00:01 | 1. 3.
| 9. PARTITION LIST THEM ALL. 187. 2244 | 3 (0) | 00:00:01 | 1. LAST |
| 10. TABLE ACCESS FULL | FLOATING_RATE_INDEX | 187. 2244 | 3 (0) | 00:00:01 | 1. 14.
| * 11 | INDEX UNIQUE SCAN | FLOATING_RATE_INDEX_P_UK1 | 1. 13. 0 (0) | 00:00:01 |
| 12. RANGE OF PARTITION ALL THE | 1. 74. 4 (0) | 00:00:01 | 1. 3.
| 13. PARTITION LIST THEM ALL. 1. 74. 4 (0) | 00:00:01 | 1. LAST |
| 14. TABLE ACCESS BY LOCAL INDEX ROWID | QUOTE_UNDERLYING | 1. 74. 4 (0) | 00:00:01 | 1. 14.
| * 15 | INDEX RANGE SCAN | QUOTE_UNDERLYING_PK2 | 1 | | 3 (0) | 00:00:01 | 1. 14.
| * 16. INDEX UNIQUE SCAN | QUOTE_UNDERLYING_P_UK3 | 1. 18. 1 (0) | 00:00:01 |
| * 17. HASH JOIN | 3864 | 599K | 2344 (3) | 00:00:29 |
| * 18. HASH JOIN | 4476. 616K | 1752 (3) | 00:00:22 |
| * 19. HASH JOIN | 4448 | 295K | 920 (4) | 00:00:12 |
| * 20. TABLE ACCESS FULL | INST_FRA_P | 4448 | 80064 | 636 (5) | 00:00:08 |
| 21. TABLE ACCESS FULL | INST_FRA_LBL | 60071 | 2933K | 283 (2) | 00:00:04 |
| * 22. VIEW | the index $ _join$ _001. 9440. 672KO | 831 (2) | 00:00:10 |
| * 23. HASH JOIN |
| * 24. INDEX RANGE SCAN | QUOTE_UND_LBL_TYP_IDX | 9440. 672KO | 103 (2) | 00:00:02 |
| 25. FULL RESTRICTED INDEX SCAN FAST | QUOTE_UNDERLYING_LBL_UK1 | 9440. 672KO | 727 (1) | 00:00:09 |
| * 26. INDEX RANGE SCAN | QUOTE_UNDERLYING_P_UK3 | 114K | K 2005 | 590 (1) | 00:00:08 |
--------------------------------------------------------------------------------------------------------------------------------------

Information of predicates (identified by the operation identity card):
---------------------------------------------------

1 - access("QU".") OBJECT_KEY "= VALUE(KOKBF$))"
3 - access("FRA".") FLOATING_RATE_INDEX_KEY "=" FRI ". "KEY" (+)) "
11 - access("I_P".") FLOATING_RATE_INDEX_ID '= 'I'." FLOATING_RATE_INDEX_ID' AND 'I_P '. "VERSION_ID"= "I". "" VERSION_ID "AND
'I_P '. "LABEL_ID"= 26217)
15 - access("I".") QUOTE_UNDERLYING_ID '=' QI '. ("' QUOTE_UNDERLYING_ID")
16 - access("QI_P".") LABEL_ID '= 26217 AND 'QI_P'." QUOTE_UNDERLYING_ID '=' QI '. "" QUOTE_UNDERLYING_ID "AND
'QI_P '. "" VERSION_ID "=" QI ". ("" VERSION_ID ")
17 - access("QU_P".") QUOTE_UNDERLYING_ID "=" WHAT ". "" QUOTE_UNDERLYING_ID "AND"QU_P ". "" VERSION_ID "=" WHAT ". ("" VERSION_ID ")
18 - access("QU".") QUOTE_UNDERLYING_ID "=" FRA ". ("' QUOTE_UNDERLYING_ID")
19 - access("FRA".") INST_FRA_ID "=" FRA_P. " "" INST_FRA_ID "AND"FRA ". "" VERSION_ID "=" FRA_P. " ("" VERSION_ID ")
20 - filter("FRA_P".") LABEL_ID "= 26217)
22 - filter("QU".") QUOTE_UNDERLYING_TYPE_CD "=" FRA")
23 - access (ROWID = ROWID)
24 - access("QU".") QUOTE_UNDERLYING_TYPE_CD "=" FRA")
26 - access("QU_P".") LABEL_ID "= 26217)


Query 2: (WITHOUT the TYPE CAST)*.
SELECT '1'
OF quote_underlying_lbl as
quote_underlying_p qu_p
inst_fra_lbl fra
inst_fra_p fra_p
(SELECT qi.object_key as key, ID qi.quote_underlying_id
qi.version_id version, i.category as category
, qi.currency_cd as currency, i.floating_rate_index_id
Floating_rate_index I have
quote_underlying qi
floating_rate_index_p i_p
quote_underlying_p qi_p
WHERE i.quote_underlying_id = qi.quote_underlying_id
AND i_p.floating_rate_index_id = i.floating_rate_index_id
AND i_p.version_id = i.version_id
AND i_p.label_id = 26217
AND qi_p.quote_underlying_id = qi.quote_underlying_id
AND qi_p.version_id = qi.version_id
AND qi_p.label_id = 26217
) Fri
-WHERE qu.object_key IN (SELECT k.column_value FROM TABLE (CAST (: l_qu_key_Arr AS STRING2_ARRAY_CT)) k)
WHERE qu.object_key IN (-SELECT k.column_value FROM TABLE (CAST (STRING2_ARRAY_CT ())
"xyz."
"xyz1"
"xyz2."
"xyz3,"
'xyz4 '.
-) AS STRING2_ARRAY_CT)) k
)
AND qu.quote_underlying_id = fra.quote_underlying_id
AND qu.quote_underlying_type_cd = "FRA".
AND qu_p.quote_underlying_id = qu.quote_underlying_id
AND qu_p.version_id = qu.version_id
AND qu_p.label_id = 26217
AND qu.quote_underlying_id = fra.quote_underlying_id
AND fra.inst_fra_id = fra_p.inst_fra_id
AND fra.version_id = fra_p.version_id
AND fra_p.label_id = 26217
-Filter FRI
AND fra.floating_rate_index_key = fri.key (+)

------------------------------------------------------------------------------------------------------------------------------------
| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |
------------------------------------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | 1. 194. 305 (3) | 00:00:04 |
| 1. NESTED EXTERNAL LOOPS | 1. 194. 305 (3) | 00:00:04 |
| 2. NESTED LOOPS | 1. 190. 296 (3) | 00:00:04 |
|* 3 | HASH JOIN | 3. 516. 293 (3) | 00:00:04 |
| 4. NESTED LOOPS | 1. 91. 9 (0) | 00:00:01 |
| 5. INLIST ITERATOR.
| 6. TABLE ACCESS BY INDEX ROWID | QUOTE_UNDERLYING_LBL | 1. 73. 8 (0) | 00:00:01 |
|* 7 | INDEX RANGE SCAN | QUOTE_UND_LBL_TYP_IDX | 1 | | 7 (0) | 00:00:01 |
|* 8 | INDEX UNIQUE SCAN | QUOTE_UNDERLYING_P_UK3 | 1. 18. 1 (0) | 00:00:01 |
| 9. TABLE ACCESS FULL | INST_FRA_LBL | 60071 | 4751K | 283 (2) | 00:00:04 |
| * 10 | INDEX UNIQUE SCAN | INST_FRA_P_UK1 | 1. 18. 1 (0) | 00:00:01 |
| 11. SEE PUSHED PREDICATE. 1. 4. 8 (0) | 00:00:01 |
| 12. NESTED LOOPS | 1. 178. 8 (0) | 00:00:01 |
| 13. NESTED LOOPS | 1. 160. 7 (0) | 00:00:01 |
| 14. NESTED LOOPS | 1. 25. 3 (0) | 00:00:01 |
| 15. RANGE OF PARTITION ALL THE | 187. 2244 | 3 (0) | 00:00:01 | 1. 3.
| 16. PARTITION LIST THEM ALL. 187. 2244 | 3 (0) | 00:00:01 | 1. LAST |
| 17. TABLE ACCESS FULL | FLOATING_RATE_INDEX | 187. 2244 | 3 (0) | 00:00:01 | 1. 14.
| * 18. INDEX UNIQUE SCAN | FLOATING_RATE_INDEX_P_UK1 | 1. 13. 0 (0) | 00:00:01 |
| * 19. TABLE ACCESS BY INDEX ROWID | QUOTE_UNDERLYING | 1. 135. 4 (0) | 00:00:01 | ROWID | ROWID |
| * 20. INDEX RANGE SCAN | QUOTE_UNDERLYING_IDX | 1 | | 2 (0) | 00:00:01 |
| * 21. INDEX UNIQUE SCAN | QUOTE_UNDERLYING_P_UK3 | 1. 18. 1 (0) | 00:00:01 |
------------------------------------------------------------------------------------------------------------------------------------

Information of predicates (identified by the operation identity card):
---------------------------------------------------

3 - access("QU".") QUOTE_UNDERLYING_ID "=" FRA ". ("' QUOTE_UNDERLYING_ID")
7 - access("QU".") QUOTE_UNDERLYING_TYPE_CD «= "FRA" AND ("QU".» OBJECT_KEY "=" obj://frisk/instrument/fra/EUR-EURIBOR/2008-12-1
1/2008-12-17"OR"QU ". "OBJECT_KEY"= "obj://frisk/instrument/fra/EUR-LIBOR/2008-12-11/2008-12-17" OR ".
"QU". "OBJECT_KEY"= "obj://frisk/instrument/fra/GBP-LIBOR/2009-02-03/2009-02-06" OR ".
"QU". "OBJECT_KEY"= "obj://frisk/instrument/fra/JPY-LIBOR/2011-08-11/2011-11-11" OR ".
"QU". (("OBJECT_KEY"="obj://frisk/instrument/fra/JPY-TIBOR/2010-08-11/2010-11-11"))
8 - access("QU_P".") LABEL_ID '= 26217 AND 'QU_P'." QUOTE_UNDERLYING_ID "=" WHAT ". "" QUOTE_UNDERLYING_ID "AND
'QU_P '. "" VERSION_ID "=" WHAT ". ("" VERSION_ID ")
10 - access("FRA".") INST_FRA_ID "=" FRA_P. " "" INST_FRA_ID "AND"FRA ". "" VERSION_ID "=" FRA_P. " "" VERSION_ID "AND
'FRA_P '. "LABEL_ID"= 26217)
18 - access("I_P".") FLOATING_RATE_INDEX_ID '= 'I'." FLOATING_RATE_INDEX_ID' AND 'I_P '. "VERSION_ID"= "I". "" VERSION_ID "AND
'I_P '. "LABEL_ID"= 26217)
19 - filter("I".") QUOTE_UNDERLYING_ID '=' QI '. ("' QUOTE_UNDERLYING_ID")
20 - access("QI".") OBJECT_KEY "=" FRA ". ("' FLOATING_RATE_INDEX_KEY")
21 - access("QI_P".") LABEL_ID '= 26217 AND 'QI_P'." QUOTE_UNDERLYING_ID '=' QI '. "" QUOTE_UNDERLYING_ID "AND
'QI_P '. "" VERSION_ID "=" QI ". ("" VERSION_ID ")

Kind regards
Krishan-

Published by: user10953050 on March 31, 2009 09:21

When dealing with tables cast as that Oracle assumes by default there are 8168 lines (this default value depends on the block size of your database, that number implies a block size of 8 K).

Here's a simple example.

ME_XE? CREATE or replace TYPE NUMBERTBLTYPE AS TABLE OF NUMBER(38);
  2  /

Type created.

Elapsed: 00:00:00.23
ME_XE?explain plan for
  2  select column_value from table(numbertbltype(1,2,3,4,5,6,7,8,9,10)) T;

Explained.

Elapsed: 00:00:00.03
ME_XE?
ME_XE?select * from table(dbms_xplan.display(NULL, NULL, 'ALL'));

PLAN_TABLE_OUTPUT
-----------------------------------------------------------------------------------------------------------------------
Plan hash value: 1748000095

----------------------------------------------------------------------------------------------
| Id  | Operation                             | Name | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                      |      |  8168 | 16336 |    29   (0)| 00:00:01 |
|   1 |  COLLECTION ITERATOR CONSTRUCTOR FETCH|      |       |       |            |          |
----------------------------------------------------------------------------------------------

Query Block Name / Object Alias (identified by operation id):
-------------------------------------------------------------

   1 - SEL$1F3D9D0A

Column Projection Information (identified by operation id):
-----------------------------------------------------------

   1 - VALUE(A0)[22]

18 rows selected.

Elapsed: 00:00:00.07
ME_XE?
ME_XE?explain plan for
  2  select /*+ CARDINALITY ( T 10 ) */ column_value from table(numbertbltype(1,2,3,4,5,6,7,8,9,10)) T;

Explained.

Elapsed: 00:00:00.28
ME_XE?
ME_XE?select * from table(dbms_xplan.display(NULL, NULL, 'ALL'));

PLAN_TABLE_OUTPUT
-----------------------------------------------------------------------------------------------------------------------
Plan hash value: 1748000095

----------------------------------------------------------------------------------------------
| Id  | Operation                             | Name | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                      |      |    10 |    20 |    29   (0)| 00:00:01 |
|   1 |  COLLECTION ITERATOR CONSTRUCTOR FETCH|      |       |       |            |          |
----------------------------------------------------------------------------------------------

Query Block Name / Object Alias (identified by operation id):
-------------------------------------------------------------

   1 - SEL$1F3D9D0A

Column Projection Information (identified by operation id):
-----------------------------------------------------------

   1 - VALUE(A0)[22]

18 rows selected.

Elapsed: 00:00:00.06
ME_XE?

Tags: Database

Similar Questions

  • Need help with problems of performance with 14 elements

    I scanned the forums and provided below to help with feedback. At this point, the organizer of the elements is unusable for me - I'm looking for suggestions to help refine the installer to make it usable.

    MY SETUP

    • Just more than 50000 items in the catalog, about 95% of them are photos, videos of rest. 98% of the source files are on a drive to the server in my house, with a gigabit connection.
    • I left full recognition of faces (took two days!) and Yes, during that who was running the organizer was unusable.
    • My PC is an i7 - 4790 k with 16 GB of RAM. Windows Pro 10. Boot drive is SSD.

    THE SCENARIO

    I have a new series of images on my C drive local - images that I scanned, about 30 pictures. Using the view of the pane left records that I navigate to the folder on my C drive. If I move to the tab places it takes about 25 seconds to react and make enforcement appear the places page. If I then go to the people tab it takes about 75 seconds, for the application to respond. In both cases, the application is completely insensitive during the wait.

    Clearly, I can't clean my collection with this kind of response. So here are my questions:

    1. What are the key strategies to improve performance, given my configuration?
    2. Have I not too many objects in the catalog? Should I aim lower number? I saw that there is no actual limit but I feel Im beyond a theoretical limit of messages.
    3. Broken content is to catalog help with questions like this? Is there another internal setting, I should be updated or change?
    4. Given the number of images should I use Lightroom instead?

    The only change that I'm not going to do is to move all the content of my return to my local drive. Sound on the server so that it is completely backed up and protected. So I'm looking for ideas that help given this configuration.

    Thanks to everyone for their help.

    Mark

    mgill2012 wrote:

    .........

    Thanks to everyone for their help.

    Mark

    Mark,

    I can't offer a positive solution to your problem, but I hope to give you some answers or thoughts on this subject.

    Let's start with the description of your case: it's a perfect description of what has been reported in several positions:

    -powerful Installer (computer, SSD)

    -l' use of the recognition of people and/or geolocation

    -use of a NAS for the library.

    -Library of more than 50,000 points.

    -very long indexing, then extremely slow.

    I do not use a SSD (will probably later) or a NAS (I never do). I 65 000 objects and don't care about recognition of face or geolocation, which explains that with a basic setup on I3, 8 GB of RAM, I have an organizing extremely fast speed. Even on an old secondary computer with Vista, it is still quite manageable.

    Your choice is typical of advanced specialists and competent (I guess that less than 1% of the current user of items based). I have yet to see no answer (satisfactory or not...) Adobe staff.

    Given the number of images should I use Lightroom instead?

    I guess that's what Adobe could answer you... and that would be wise. You can use a trial version to make your choice and do a search on the forum for Lightroom. I have not seen similar, even if complaints with NASs, it seems to be a lot to say. Lightroom can convert your organizing catalogs (maybe some problems lately...)

    The only change that I'm not going to do is to move all the content of my return to my local drive. Sound on the server so that it is completely backed up and protected. So I'm looking for ideas that help given this configuration.

    If the use of the network is primarily to ensure maximum security (for not sharing images), why not would you use the choice to store your library on your computer (internal or external disk) with a sync to your NAS as a backup solution? I can tell you that my workflow includes Windows Synctoy to record each session easily and quickly (catalogs and libraries).

    Your very precise description of the case call to assess each factor of different performance individually. Even if the method above is not the final answer, it could shed light on the influence of the use of the network.

    1. Have I not too many objects in the catalog? Should I aim lower number? I saw that there is no actual limit but I feel Im beyond a theoretical limit of messages.
    2. Broken content is to catalog help with questions like this?

    Splitting the catalog is usually a very bad solution, a number of post seems to show that with the recognition of the people/geotagging, the problems around the range of 50,000 points. You can make a copy of the catalog and remove half of the files to check the influence of numbers point; Maybe it's possible with version 14 (deletion is extremely slow, but worked for me, even if it failed with older versions).

    Is there another internal setting, I should be updated or change?

    Sorry, I can't help you there...

    Other factors are using recognition Geotagging and people. Even if you absolutely need those features, disable to see their influence could help Adobe to solve performance issues.

  • Facing problems of performance with ESXi

    Dear Sir

    I am facing a problem and I couldn't find a solution for her, I have two virtual environment on the site of min and the other on the recovery site, and I use SRM between them.

    The main site contains 12 SUN 6270 blade system 5.1 of VMware ESXi and vcenter 5.1 with clarion Cx4 (SAN storage)

    The DR site contain 5 blade Dell 5.1 of VMware ESXi and vCenter 5.1 with clarion CX4 (SAN storage) system

    I'm Clariion Storage VMAX, my question is on the main site when I add and mount LUN to ESXi hosts when I rescan there took an hour to complete a new analysis, the performance is very bad, in the face of the strange disconnect on the issue of the host, although I checked the compatibility between the Sun and ESXi 5.1 It is compatible

    the DR I'm not confronted with this problem it is fast and the performance is excellent.

    I need a solution please

    Fixed after I removed the clarion and fix some issues on Sun blades fiber cards

    performance of becoming better than before

  • Performance issue Bulk Insert PL/SQL table type

    Hi all

    I put in work of a batch to fill a table with a large number of data records(>3,000,000). To reduce the execution time, I used PL/SQL tables to temporarily store data that must be written to the destination table. Once all documents are piling up in the PL/SQL table I use a FORALL operator for bulk insert the records in the physical table.

    Currently, I follow two approaches to implement the process described above. (Please see the code segments below). I need to choose how to best wise performance between these two approaches. I really appreciate all the comments of experts about the runtime of the two approaches.

    (I don't see much difference in consumption of time in my test environment that has limited the data series. This process involves building a complex set of structures of large product once deployed in the production environment).


    Approach I:_
    DECLARE
    TYPE of test_type IS test_tab % ROWTYPE directory INDEX TABLE;
    test_type_ test_type.
    ins_idx_ NUMBER;
    BEGIN
    ins_idx_: = 1;
    NESTED LOOPS
    test_type_ (ins_idx_) .column1: = value1;
    test_type_ (ins_idx_) .column2: = value2;
    test_type_ (ins_idx_) .column3: = value3;
    ins_idx_: = ins_idx_ + 1;
    END LOOP;

    I_ FORALL in 1.test_type_. COUNTY
    INSERT INTO test_tab VALUES (i_) test_type_;
    END;
    /


    Approach II:_
    DECLARE
    Column1 IS a TABLE OF TYPE test_tab.column1%TYPE INDEX DIRECTORY.
    Column2 IS a TABLE OF TYPE test_tab.column2%TYPE INDEX DIRECTORY.
    Column3 IS a TABLE OF TYPE test_tab.column3%TYPE INDEX DIRECTORY.
    column1 column1_;
    column2_ Column2;
    column3_ Column3;
    ins_idx_ NUMBER;
    BEGIN
    ins_idx_: = 1;
    NESTED LOOPS
    column1_ (ins_idx_): = value1;
    column2_ (ins_idx_): = value2;
    column3_ (ins_idx_): = value3;
    ins_idx_: = ins_idx_ + 1;
    END LOOP;

    FORALL idx_ in 1.column1_. COUNTY
    INSERT
    IN n_part_cost_bucket_tab)
    Column1,
    Column2,
    Column3)
    VALUES)
    column1_ (idx_),
    column2_ (idx_),
    column3_ (idx_));
    END;
    /

    Best regards
    Lorenzo

    Published by: nipuna86 on January 3, 2013 22:23

    nipuna86 wrote:

    I put in work of a batch to fill a table with a large number of data records(>3,000,000). To reduce the execution time, I used PL/SQL tables to temporarily store data that must be written to the destination table. Once all documents are piling up in the PL/SQL table I use a FORALL operator for bulk insert the records in the physical table.

    Performance is more than just reducing the execution time.

    Just as smashing a car stops more than a car in the fastest possible time.

    If it was (breaking a car stopping all simply), then a brick with reinforced concrete wall construction, would have been the perfect way to stop all types of all sorts of speed motor vehicles.

    Only problem (well more than one actually) is that stop a vehicle in this way is bad for the car, the engine, the driver, passengers and any other content inside.

    And pushing 3 million records in a PL/SQL 'table' (btw, that is a WRONG terminology - there no PL/SQL table structure) in order to run a SQL cursor INSERT 3 million times, to reduce the execution times, is no different than using a brick wall to stop a car.

    Both approaches are pretty well imperfect. Both places an unreasonable demand on the memory of the PGA. Both are still row-by-row (aka slow-by-slow) treatment.

  • to solve the problems of performance (running slow SQL queries), which should be the systematic approach

    Hello

    I am new to oracle.  Need some advice on how we should approach to problems of performance especially for SQL queries running slow on the database.

    Thanks in advance.

    6e85b3c2-5f02-40CB-A8AD-d2279f63b4be wrote:

    Hello

    I am new to oracle.  Need some advice on how we should approach to problems of performance especially for SQL queries running slow on the database.

    Thanks in advance.

    Start here;  http://docs.Oracle.com/CD/E11882_01/server.112/e10822/TOC.htm

    Continue here: http://docs.oracle.com/cd/E11882_01/server.112/e41573/toc.htm

  • Is there a problem with ValueChangeListener and af: table?

    Hello...

    I use JDeveloper 11.1.2.0.0

    Is there a problem with ValueChangeListener and af: table.

    Here my problem...

    I have two inputtext in af:table and I want to change the value of inputtext2 when I change the value of inputtext1
    so I put the autosubmit = "true" to inputtext1 and set the valuechangelistener method that is in the page bean
    and I put the partial inputtext2 trigger = "inputtext1 id".

    but when I run the page and change the value of inputtext1 that nothing happens.

    But if I have the previous scenario in af:panelFormLayout instead of af: table its work and the value of inputtext2 is changed to the user.

    any ideas...

    Thans.

    Sorry for the delay... :(

    And why if I use page JSF is the binding property disappears
    in the tab advanced in the property inspector.

    If you cannot power discovered the binding property in the palette of the means, your jsff page is automatically linked.
    If only the problem.

    try to create the new page jsff, while creating jsff, finally there is radio box something like
    do not expose the UI components automatically. check and create.

    and create a java file. Then you can bind components with the java file as you wish.

    to check your jsff page is autobinded are no means?
    Open your jsff page.

    Menu's that are on it - in this section. You can see the design menu that struck. If you hit it means you see Wizard property page go to the tab component binding
    There is a check box available

    If the box is ticked means that you page are automatically linked. If this isn't the case, you must link.

    -edited lately.

  • Unique problem with selction on the table (Query Page)

    Unique problem with selction on the table (Query Page)

    I have a VO data Bulletin Board, with a transitional attribute for selction unique column.
    My requirement is that I need to identify the line that was selected in the table.

    I associated with fireAction singleSelection column, such that whenever the user selects the line
    I'm looking for that VO using some rowIterator.
    But when running the loop of the transient VO that is mapped to the singleSelection variable is the show as "n" / NUll
    for all the lines...

    So how do you identify the selected line in singleSelection to a table.

    -Sasi

    In the property inspector of the element for which you've put firePartialAction, you can find a property named "parameters". That mention primary key as your setting.

    You can get the arameter using pageContext.getparameter ();

    -Anand

  • Help with PL/SQL table

    Hi all

    Newbie when it comes to PL/SQL tables...

    Can someone explain to me why it works and how exactly I can do the following without triggering an error?

    I have a function that accepts a PL/SQL table like in parameter.

    The PL/SQL table is defined as...
    Type TTimeTable is table of xxtzg_otl_iface_stg%rowtype index by binary_integer;
    the xxtzg_otl_iface_stg table has many columns including error_message and error_flag. If I find an error, I want to update the error_message and error_flag function. If I can get it works I will then modify the function to return to the table of PL/SQL instead of BOOLEAN
    FUNCTION validate_timecard (pTimeTable IN TTimeTable
                                                 ) RETURN BOOLEAN IS
    
      lc_module            CONSTANT VARCHAR2(25)        := 'validate_timecard';
      lEmployeeCount    PLS_INTEGER;
      lEmployeeError     VARCHAR2(1000);
      lErrorCount          PLS_INTEGER :=0;
      
      BEGIN
    
         FOR i IN 1 .. NVL(pTimeTable.COUNT,0) LOOP                                   
                                             
         xxtzg_concurrent_utils_pkg.write_log(  p_package =>  gc_package
                                                                , p_module  =>  lc_module
                                                                , p_text    =>  'Processing timecard for employee_number: '||pTimeTable(1).employee_number
                                                               );               
       
         -- Call validations before submitting the timecard to the API
         --validate employee
    
            begin
               select count(*)
                 into lEmployeeCount
                 from per_all_people_f
                where employee_number = pTimeTable(1).employee_number;
                
                if lEmployeeCount = 0 then
                
                -- Set the errors
    
                -- This assignment below does not work, I get an error message saying...
                --[Error] PLS-00363 (137: 27): PLS-00363: expression 'PTIMETABLE.ERROR_MESSAGE' cannot be used as an assignment target
    
                PTimeTable(i).error_message :=  'Employee Number '||pTimeTable(1).employee_number||' is not a valid employee';
                PTimeTable(i).error_flag := 'Y';
    
                end if;
                
            end;    
            
         END LOOP; 
         
         IF lErrorCount = 0 THEN 
         RETURN TRUE;
         ELSE
         RETURN FALSE;
         END IF;
                                               
      END;

    blue72TA wrote:

    FUNCTION validate_timecard (pTimeTable IN TTimeTable
    ) RETURN BOOLEAN IS
    ...
    
    -- This assignment below does not work, I get an error message saying...
    --[Error] PLS-00363 (137: 27): PLS-00363: expression 'PTIMETABLE.ERROR_MESSAGE' cannot be used as an assignment target
    
    PTimeTable(i).error_message :=  'Employee Number '||pTimeTable(1).employee_number||' is not a valid employee';
    PTimeTable(i).error_flag := 'Y';
    

    Your table is declared as IN only (the default if you do not explicitly set it), so you are not allowed to change its attributes in all respects, IN = read-only.

    If you want to be able to modify the values of a parameter, it must be declared as OUT parameters.

  • BAD RESULTS WITH OUTER JOINS AND TABLES WITH A CHECK CONSTRAINT

    HII All,
    Could any such a me when we encounter this bug? Please help me with a simple example so that I can search for them in my PB.


    Bug:-8447623

    Bug / / Desc: BAD RESULTS WITH OUTER JOINS AND TABLES WITH a CHECK CONSTRAINT


    I ran the outer joins with check queries constraint 11G 11.1.0.7.0 and 10 g 2, but the result is the same. Need to know the scenario where I will face this bug of your experts and people who have already experienced this bug.


    Version: -.
    SQL> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0      Production
    TNS for Solaris: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production

    Why do you not use the description of the bug test case in Metalink (we obviously can't post it here because it would violate the copyright of Metalink)? Your test case is not a candidate for the elimination of the join, so he did not have the bug.

    Have you really read the description of the bug in Metalink rather than just looking at the title of the bug? The bug itself is quite clear that a query plan that involves the elimination of the join is a necessary condition. The title of bug nothing will never tell the whole story.

    If you try to work through a few tens of thousands of bugs in 11.1.0.7, of which many are not published, trying to determine whether your application would be affected by the bug? Wouldn't be order of magnitude easier to upgrade the application to 11.1.0.7 in a test environment and test the application to see what, if anything, breaks? Understand that the vast majority of the problems that people experience during an upgrade are not the result of bugs - they are the result of changes in behaviour documented as changes in query plans. And among those who encounter bugs, a relatively large fraction of the new variety. Even if you have completed the Herculean task of verifying each bug on your code base, which would not significantly easier upgrade. In addition, at the time wherever you actually performed this analysis, Oracle reportedly released 3 or 4 new versions.

    And at this stage would be unwise to consider an upgrade to 11.2?

    Justin

  • How to execute a SQL statement that is stored within a SQL Table

    Hello

    If someone please help me with the following problem I would be eternally grateful

    I have a SQL statement that is stored inside a certain SQL table, I want to use this SQL statement inside my PL/SQL procedure.

    Thought a simple solution was to get the SQL statement in a table, and then run it, but how could I do so exactly with PL/SQL? I only started to play with PL/SQL in the last days.

    Thanks in advance!

    This is what it looks like more or less:

    Display result for:

    ---------------------

    SELECT TRIM (OBJ_VALU_TXT)

    OF OBJ_VALU_DOC

    WHERE TYPE_OBJET = 'FLD '.

    AND OBJECT_CODE = 15443

    AND OBJ_VALU_CD = 'CAB '.

    ORDER BYDOC_SEQ_NO

    00001

    ------------------------------------------------------------------

    SELECT

    VALUE (MAX (RECEIPT_NO) + 1,: OUT-COMP-FACTOR)

    THE FRONT DESK

    WHERE (RECEIPT_NO BETWEEN

    (: OUT-COMP-FACTOR AND: OUT TO A NUMBER) OR

    (RECEIPT_NO >: OUT-COMP-FACTOR AND)

    (: OUT-TO-NUMBER = 0)

    Here's a demo of your condition.

    create table t (col1 varchar2 (200));

    table created

    insert into values t ('select * from double ');

    1 row inserted

    declare
    v_col varchar2 (200);
    v_val varchar2 (200);
    Start

    Select col1 in t v_col;

    run immediately v_col in v_val;
    dbms_output.put_line (v_val);
    end;

    -----
    X

    Use in the clause, you can use as many variables as needed. But the basic approach remains the same.

    But storage in DB SQL is not an efficient design.

    Ishan

  • PL/SQL tables

    Hello guys,.
    I have a few questions about the PL/SQL tables

    (1) if I don't specify the 'INDEX BY' clause, they are indexed by PLS_INTEGER default, right?

    (2) consider this package specification
    CREATE OR REPLACE PACKAGE Testxyz AS
    
    TYPE tab_Numbers IS TABLE OF PLS_INTEGER;
    
    PROCEDURE TestNumber(ptab_Numbers IN tab_Numbers := NULL);
    
    
    END Testxyz;
    So I created a table (I hope it's standard indexed by type of data pls_integer) and I am in him passing as parameter to a procedure. Because I want this parameter be optional I assign null inside.

    Now, I change the table definition for:
    CREATE OR REPLACE PACKAGE Testxyz AS
    
    TYPE tab_Numbers IS TABLE OF PLS_INTEGER INDEX BY PLS_INTEGER;
    
    PROCEDURE TestNumber(ptab_Numbers IN tab_Numbers := NULL);
    
    
    END Testxyz;
    Try to compile it and you get:
    Error (5.53): PLS-00382: expression is of the wrong type

    Why?

    (3) because I need this optional parameter, I use the first statement:
    CREATE OR REPLACE PACKAGE Testxyz AS
    
    TYPE tab_Numbers IS TABLE OF PLS_INTEGER;
    
    PROCEDURE TestNumber(ptab_Numbers IN tab_Numbers := NULL);
    
    
    END Testxyz;
    Now I create an anonymous block, and you want to set something in the table
    DECLARE
       vtab_Numbers TESTXYZ.tab_Numbers;
    BEGIN
    
       vtab_Numbers(1) := 5;
    
    
    END;
    /
    When you try to run it, I got:
    06531 00000 - 'refers to an uninitialized collection.

    Can someone help me understand this problem?
    Is it possible to have input of type PL/SQL table setting and have a standard null, are assigned?

    Thanks, Dan

    (1) if I don't specify the 'INDEX BY' clause, they are indexed by PLS_INTEGER default, right?

    N ° or somehow.

    More critical, and using official terms of [url http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/composites.htm#CHDBHJEI] documentation so that we don't get into unnecessary arguments about the correct terms for these features, it's the difference between types of ASSOCIATIVE TABLE and the IMBRIQUEE TABLE collection.

    If you omit the "INDEX BY" clause, it is a type of TABLE IMBRIQUEE collection. A type of TABLE IMBRIQUEE is always indexed by PLS_INTEGER.

    When you include the ' INDEX OF ', this is an ASSOCIATIVE ARRAY.

    (2) consider this package specification
    Try to compile it and you get:
    Error (5.53): PLS-00382: expression is of the wrong type

    Why?

    Because you cannot assign NULL to an ASSOCIATIVE ARRAY.

    In the same way, you cannot do this:

    SQL> DECLARE
      2   TYPE tab_Numbers IS TABLE OF PLS_INTEGER INDEX BY PLS_INTEGER;
      3   v1 tab_Numbers;
      4  BEGIN
      5   v1 := NULL;
      6  END;
      7  /
     v1 := NULL;
           *
    ERROR at line 5:
    ORA-06550: line 5, column 8:
    PLS-00382: expression is of wrong type
    ORA-06550: line 5, column 2:
    PL/SQL: Statement ignored
    
    SQL> 
    

    If you want two entry points to TestNumber with an ASSOCIATIVE ARRAY or NULL then overload the procedure.

    If you want to call a procedure with a TABLE IMBRIQUE collection type you can the default empty:

    SQL> CREATE OR REPLACE PACKAGE Testxyz
      2  AS
      3   TYPE tab_Numbers IS TABLE OF PLS_INTEGER;
      4   PROCEDURE TestNumber(ptab_Numbers IN tab_Numbers DEFAULT tab_Numbers());
      5   PROCEDURE TestNumber;
      6  END Testxyz;
      7  /
    
    Package created.
    
    SQL> 
    

    (3) because I need this optional parameter, I use the first statement
    When you try to run it, I got:
    06531 00000 - 'refers to an uninitialized collection.

    Because you have not initialized it.

    Different collection types require different semantics.

    SQL> DECLARE
      2   TYPE tab_Numbers IS TABLE OF PLS_INTEGER;
      3   v1 tab_Numbers;
      4  BEGIN
      5   v1(1) := 5;
      6  END;
      7  /
    DECLARE
    *
    ERROR at line 1:
    ORA-06531: Reference to uninitialized collection
    ORA-06512: at line 5
    
    SQL> DECLARE
      2   TYPE tab_Numbers IS TABLE OF PLS_INTEGER;
      3   v1 tab_Numbers := tab_Numbers();
      4  BEGIN
      5   v1(1) := 5;
      6  END;
      7  /
    DECLARE
    *
    ERROR at line 1:
    ORA-06533: Subscript beyond count
    ORA-06512: at line 5
    
    SQL> DECLARE
      2   TYPE tab_Numbers IS TABLE OF PLS_INTEGER;
      3   v1 tab_Numbers := tab_Numbers();
      4  BEGIN
      5   v1.extend();
      6   v1(1) := 5;
      7  END;
      8  /
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    
  • date max with multiple joins of tables

    Looking for expert advice on the use of max (date) with multiple joins of tables. Several people have tried (and failed) - HELP Please!

    The goal is to retrieve the most current joined line of NBRJOBS_EFFECTIVE_DATE for each unique NBRJOBS_PIDM. There are several lines by PIDM with various EFFECTIVE_DATEs. The following SQL returns about 1/3 of the files and there are also some multiples.

    The keys are PIDM, POSN and suff

    Select NBRJOBS. NBRJOBS.*,
    NBRBJOB. NBRBJOB.*
    of POSNCTL. Inner join of NBRBJOB NBRBJOB POSNCTL. NBRJOBS NBRJOBS on (NBRBJOB. NBRBJOB_PIDM = NBRJOBS. NBRJOBS_PIDM) and (NBRBJOB. NBRBJOB_POSN = NBRJOBS. NBRJOBS_POSN) and (NBRBJOB. NBRBJOB_SUFF = NBRJOBS. NBRJOBS_SUFF)
    where NBRJOBS. NBRJOBS_SUFF <>'LS '.
    and NBRBJOB. NBRBJOB_CONTRACT_TYPE = 'P '.
    and NBRJOBS. NBRJOBS_EFFECTIVE_DATE =
    (select Max (NBRJOBS1. NBRJOBS_EFFECTIVE_DATE) as 'EffectDate '.
    of POSNCTL. NBRJOBS NBRJOBS1
    where NBRJOBS1. NBRJOBS_PIDM = NBRJOBS. NBRJOBS_PIDM
    and NBRJOBS1. NBRJOBS_POSN = NBRJOBS. NBRJOBS_POSN
    and NBRJOBS1. NBRJOBS_SUFF = NBRJOBS. NBRJOBS_SUFF
    and NBRJOBS1. NBRJOBS_SUFF <>'LS '.
    and NBRJOBS1. NBRJOBS_EFFECTIVE_DATE < = to_date('2011/11/15','yy/mm/dd'))
    order of NBRJOBS. NBRJOBS_PIDM

    Welcome to the forum!

    We don't know what you are trying to do.
    You want all of the columns in the rows where NBRJOBS_EFFECTIVE_DATE is the date limit before a given date (November 15, 2011 in this example) for all rows in the result set with this NBRJOBS_PIDM? If so, here is one way:

    with         GOT_R_NUM     as
    (
         select       NBRJOBS.NBRJOBS.*,
                NBRBJOB.NBRBJOB.*     -- You may have to give aliases, so that every column has a unique name
         ,       rank () over ( partition by  NBRJOBS.NBRJOBS_PIDM
                                   order by      NBRJOBS.NBRJOBS_EFFECTIVE_DATE     desc
                          )             as R_NUM
         from          POSNCTL.NBRBJOB NBRBJOB
         inner join      POSNCTL.NBRJOBS NBRJOBS       on    (NBRBJOB.NBRBJOB_PIDM = NBRJOBS.NBRJOBS_PIDM)
                                            and      (NBRBJOB.NBRBJOB_POSN = NBRJOBS.NBRJOBS_POSN)
                                      and      (NBRBJOB.NBRBJOB_SUFF = NBRJOBS.NBRJOBS_SUFF)
         where       NBRJOBS.NBRJOBS_SUFF             != 'LS'       -- Is this what you meant?
         and        NBRBJOB.NBRBJOB_CONTRACT_TYPE   ='P'
         and       NBRJOBS.NBRJOBS_EFFECTIVE_DATE  <= to_date ('2011/11/15', 'yyyy/mm/dd')
    )
    select       *     -- Or list all columns except R_NUM
    from       GOT_R_NUM
    where       R_NUM          = 1
    order by  NBRJOBS_PIDM
    ;
    

    Normally this site does not display the <>inequality operator; He thinks it's some kind of beacon.
    Whenever you post on this site, use the other inequality operator (equivalent), *! = *.

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and INSERT, only relevant columns instructions) for all the tables involved and the results desired from these data.
    Explain, using specific examples, how you get these results from these data.
    Always tell what version of Oracle you are using.
    You will get better results faster if you always include this information whenever you have a problem.

  • Problem dark videoconference with WinLive Messenger and LifeCam VX-3000

    My LifeCam VX-3000 webcam cannot support a video call in Windows Live Messenger. I can text back OK, and sound and motion video work very well when I check the audio/video settings. When I try a video connection, the system hangs on my end... the other party may accept the call but my end still ringing and the video image is frozen... There is no sound during this video call attempt.   The system is XP Home SP3... all security is up to date. I use a 6 Mbit internet service.  I did a complete uninstall of Windows Live Essentials, re-installed components and get the same result. This Setup worked fine until a week ago.  This problem would have started at the time, I installed and started using MagicJack, but I tried to uninstall Magic Jack and the result is the same. Maybe another change is that Windows Live Messenger has offered an upgrade to a newer version that was made.  I'm looking for some ideas on any peripheral or software conflicts and methods to isolate or resolve them.

    Hello

    Method 1.
    First of all I ask you to re - install the Microsoft Life Cam software and drivers from the link below and then check out.
    http://www.Microsoft.com/hardware/download/download.aspx?category=ice
     
    Method 2.
    If the problem persists, perform a clean boot to find any conflicting with the Windows Live Messenger application.
    For more inoformation on boot, refer to the article below.
    How to configure Windows XP to start in a "clean boot" State
    http://support.Microsoft.com/kb/310353
    Note: Don't forget to set the computer to start normal, as mentioned in the above article.
    Also update the chipset drivers and check. You may need to contact the manufacturer of the computer for that.
    I hope this helps.

    Thank you, and in what concerns:
    Shekhar S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.
    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Problem of indexing with Google Drive sync folder

    Indexing is working in all areas on my Windows 7 computer, except for my folder of Google Sync Drive.  I have already ruled out a problem with google reader.  No there.  Seems to be an indexing problem associated with this folder.  Any suggestions to fix this problem of indexing?

    Hello

    Welcome to the Microsoft Community Forums. I understand that you are facing problem of indexing with Google Sync Drive folder.

    You did changes to the computer before the show?

    I suggest the link and follow the steps in troubleshooting.

    Improve Windows searches using the index: frequently asked questions.

    http://Windows.Microsoft.com/en-in/Windows7/improve-Windows-searches-using-the-index-frequently-asked-questions

    Refer to how to solve problems with search and indexing?

    If the problem persists after you perform the steps in troubleshooting from the link above and if you have problem in Windows, please do not hesitate to answer us, we will be happy to help you.

    Thank you.

  • with the clause against table inline

    Dear Experts,

    With clause or inline table are identical from the point of view of performance.

    What query is better?

    query with clause

    with table_getbuckets as
    (
    SELECT * FROM TABLE(pack_activitymonitoring.f_getmatbuckets (start_settle_date,end_settle_date))
    )
    SELECT
          nvl(baludhar.pct,0) AS pctudhar
    FROM t_option opt
    LEFT OUTER JOIN table_getbuckets balinv ON
                opt.a_id = balinv.collateral_a_id AND
                opt.s_id = balinv.s_id
    WHERE opt.for_principal=1
    
    

    query without a clause

    SELECT
          nvl(baludhar.pct,0) AS pctudhar
    FROM t_option opt
    LEFT OUTER JOIN (
                     TABLE(pack_activitymonitoring.f_getmatbuckets
                                                        (start_settle_date,end_settle_date))
      ) balinv ON
                opt.a_id = balinv.collateral_a_id AND
                opt.s_id = balinv.s_id
    WHERE opt.for_principal=1
    
    

    In this case, since you are using only the view inline once, I expect to exercise the same.

    For purposes of readability, I prefer the one that uses the WITH clause.

Maybe you are looking for