Query took too much time when adding new column to the table and the index set on this

I added a new column to the table that contains thousands of records. and created the composite index with three columns (those newly added + two existing column)

for the specifics. TBL table there are two columns col1, col2

I added the new column col3 to TBL and created composit index (col1, col2, col3).

Now for all the records in col3 is NULL. When I choose on this table, it takes too long...

Any idea what my I do bad., I have check the query plan, it is using the index

It is solved using collection of statistics using the

DBMS_STATS. GATHER_TABLE_STATS

@Top.Gun thanks for your review...

Tags: Database

Similar Questions

  • Problem when adding new column on table with report form

    Hello

    I have a form on table (either emp) with report(select_empno,ename,job_from_emp).i have insert, update, delete operations on the table.

    Now I added a new column DOB for alteration report emp.i sql query to show the new column altered report.i insert process (Block anonymous plsql) to insert this column too all by creating a new row.but the problem is with update.i am not able to find how to upgrade this new column while doing the update to line level.

    pls let me know if you can give some ideas on this.


    Kind regards
    CK

    Well, sorry for sounding terse.

    I have a few questions.

    Have you added the item to the form page and associated with the database column?
    You use your own PL/SQL page process to update or do you use the 'row emp process' process produced auto?
    If it's your own please send the code with the word {noformat}

    {noformat} (with the curly brackets and in lower case) above and below it. Your code should be formatted like this once you've hit post message:
    

    BEGIN

    NULL;

    END;

    Cheers
    
    Ben                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    
  • When adding new record create id data and the static information

    Hi, I have a tabe datbase like this:

    CREATE TABLE 'paper')
    'id_paper' INTEGER (11) NOT NULL AUTO_INCREMENT,
    'sample_url' varchar (50) COLLATE utf8_general_ci NOT NULL DEFAULT ",
    PRIMARY KEY ('id_paper')


    When I add the new record, I need the "sample_url" field to automatically add this information:

    images/15_sample.jpg.

    images - is subfolder where my pictures are stored
    15. is id_paper (primary news NuméroAuto ID)
    _sample.jpg - static and must be added.

    I use adobedeveloper Toolbox to generate code with minor changes, I'm no guru php either.

    I retrieve my data like this:

    SELECT
    Paper.ID_PAPER,
    Paper.sample_url,
    Concat ("< img src = images /', sample_url, ' ' ' width ="66"height ="174"/ >") AS sample
    Of
    paper

    I use this code to add fields:

    Add columns
    $ins_paper-> setTable ("paper");
    $ins_paper-> addColumn ("sample_url", "STRING_TYPE", "POST", "sample_url");
    $ins_paper-> setPrimaryKey ("id_paper", "NUMERIC_TYPE");

    It's php for the text box:

    < b >
    < class td = "KT_th" > < label for = "sample_url" > sample_url: < / label > < table >
    < td > < input type = "text" name = "sample_url" id = "sample_url" value = "<?" PHP echo KT_escapeAttribute ($row_rspaper ['sample_url']); ">" size = "32" / >
    <? PHP echo $tNGs-> displayFieldHint ("sample_url");? > <? PHP echo $tNGs-> displayFieldError ("paper", "sample_url");? > < table >
    < /tr >


    What should I change?

    I think in this line here:
    < td > < input type = "text" name = "sample_url" id = "sample_url" value = "<?" PHP echo KT_escapeAttribute ($row_rspaper ['sample_url']); ">" size = "32" / >
    I need to add php code to get the primary key ID and my static text too, but how?

    Hello

    Well the modified code is irrelevent at this stage. The custom trigger should do the trick. Test on my test server here it worked fine. So, something is missing. I was even going to the point of adding nothing to the sample_url field and he was always fill the db.

    It's my registerTriggers

    $ins_paper-> registerTrigger ('STARTER', "Trigger_Default_Starter", 1, "POST", "KT_Insert1");
    $ins_paper-> registerTrigger ("FRONT", "Trigger_Default_FormValidation", 10, $masterValidation);
    $ins_paper-> registerTrigger ("END", "Trigger_Default_Redirect", 99, "paper.php? done");
    $ins_paper-> registerTrigger ("AFTER", "Trigger_LinkTransactions", 98);
    $ins_paper-> registerTrigger ("ERROR", "Trigger_LinkTransactions", 98);
    $ins_paper-> registerTrigger ("AFTER", "Trigger_Custom", 50);

    Maybe you can post a txt file with the uninstall code?

    I really think at this point it's something small.

  • When adding new events to the calendar for Thunderbird lighting plugin, the application refreshes and removes recently added events.

    I have three calendars ICS (network) in lightning. All have offline support checked in the settings.
    Yesterday I opened TB and lightning to find all events that I had entered disappeared (there for a split second then it regenerated).

    My Calendars online are in the electronics/Pim 'Horde' mail system provided by my Web host.

    I tried several tests and disabled the Auto-Refresh feature (a solution proposed by another article), however the entries created in lightning disappear spontaneously. However, these events that I create in the online version of the calendar persist. So it would seem that they never actually get downloaded (synchronized) in the online master calendar.

    I use ICS as the online master calendar access method.

    Any help solving this would be appreciated, otherwise I'll have to remove the light and find a replacement.

    Concerning

    Adam

    ICS is a file format and are not really suitable for a network schedule. Apple cannot do anything more than read only works on their Ical calendars and for reading writing recommend CalDav. Horde maybe has a similar problem.

    Their web site, I noticed that they support CalDav. This is a calendar designed from scratch like this network protocol.

    This seems to be instructions on how to locate the URL caldav in the Horde, but knowing nothing about the product I don't really know. http://wiki.Horde.org/CalDAV

  • BlackBerry Smartphones eliminating action of auto-sync when adding new entry in the calendar on my BB Curve 8330

    Hello world

    I use my Yahoo email address as my main profile to my calendar (CICAL) and messaging (CMIME) as my default Services.  I do a daily sync with my Outlook 2003 calendar, contacts, notes, etc., via the USB port but I will not sync my BB calendar with my Yahoo calendar (I don't even use Yahoo calendar besides).  Whenever I have to edit a record on my BB calendar I see arrows at the top right flashes.  I guess that means that my curve trying to synchronize changes made to another application, may Yahoo calendar.  How can I disable this feature?  I want to reduce the most possible the wireless transmission of my BB and I think that it is a useless activity since I am not wireless sync my calendar for something else.

    Thank you.

    It has nothing to do with the fact that your yahoo email is configured on your BB, although its default configuration BOF calendar. It will not sync wireless with yahoo. It is not possible unless you have yahoo GO application, which I did not even think synchronizes with your BB calendar, just gives you direct access to your yahoo calendar.

    My BB has always arrows, rarely is it not... it does not mean that final data... for data control... checking doesn't use your data, not only the sending and receiving

  • Query to consume too much time.

    Hello
    I use the Release of oracle 10.2.0.4.0 version. I have a query, its takes too long (about 7 minutes) for indexed read. Please help me understand the reason and workaround for same.
      select *
     FROM a,
             b
       WHERE  a.xdt_docownerpaypk = b.paypk
             AND a.xdt_doctype = 'PURCHASEORDER'
             AND b.companypk = 1202829117
             AND a.xdt_createdt BETWEEN TO_DATE (
                                                                 '07/01/2009',
                                                                 'MM/DD/YYYY')
                                                          AND TO_DATE (
                                                                 '01/01/2010',
                                                                 'MM/DD/YYYY')
    ORDER BY a.xdt_createdt DESC;
    
    
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    | Id  | Operation                      | Name                    | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |  OMem |  1Mem | Used-Mem |
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    |   1 |  SORT ORDER BY                 |                         |      1 |      1 |    907 |00:06:45.83 |   66716 |  60047 |   478K|   448K|  424K (0)|
    |*  2 |   TABLE ACCESS BY INDEX ROWID  | a                       |      1 |      1 |    907 |00:06:45.82 |   66716 |  60047 |       |       |          |
    |   3 |    NESTED LOOPS                |                         |      1 |      1 |   6977 |00:06:45.64 |   60045 |  60030 |       |       |          |
    |   4 |     TABLE ACCESS BY INDEX ROWID| b                       |      1 |      1 |      1 |00:00:00.01 |       4 |      0 |       |       |          |
    |*  5 |      INDEX RANGE SCAN          | IDX_PAYIDENTITYCOMPANY  |      1 |      1 |      1 |00:00:00.01 |       3 |      0 |       |       |          |
    |*  6 |     INDEX RANGE SCAN           | IDX_XDT_N7              |      1 |   3438 |   6975 |00:06:45.64 |   60041 |  60030 |       |       |          |
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       2 - filter(("a"."XDT_CREATEDT"<=TO_DATE(' 2010-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
                  "a"."XDT_CREATEDT">=TO_DATE(' 2009-07-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss')))
       5 - access("b"."COMPANYPK"=1202829117)
       6 - access("XDT_DOCTYPE"='PURCHASEORDER' AND "a"."XDT_DOCOWNERPAYPK"="b"."PAYPK")
           filter("a"."XDT_DOCOWNERPAYPK"="b"."PAYPK")
    
    
    32 rows selected.
    
    
    index 'idx_xdt_n7' is on (xdt_doctype,action_date,xdt_docownerpaypk).
    index idx_xdt_n7 details are as below.
    blevel   distinct_keys   avg_leaf_blocks_per_key   avg_data_blocks_per_key   clustering_factor       num_rows 
    3         868840             1                         47                     24020933               69871000
    
    
    But when i am deriving exact value of paypk from table b and applying to the query, its using another index(idx_xdt_n4) which is on index 'idx_xdt_n4' is on (month,year,xdt_docownerpaypk,xdt_doctype,action_date)
    and completes within ~17 seconds. below is the query/plan details.
    
    
      select *
      FROM a
        WHERE a.xdt_docownerpaypk = 1202829132
              AND xdt_doctype = 'PURCHASEORDER'
             AND a.xdt_createdt BETWEEN TO_DATE (
                                                                  '07/01/2009',
                                                                  'MM/DD/YYYY')
                                                           AND TO_DATE (
                                                                  '01/01/2010',
                                                                  'MM/DD/YYYY')
     ORDER BY xdt_createdt DESC;
    
     ------------------------------------------------------------------------------------------------------------------------------------------------------
    | Id  | Operation                    | Name                    | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |  OMem |  1Mem | Used-Mem |
    ------------------------------------------------------------------------------------------------------------------------------------------------------
    |   1 |  SORT ORDER BY               |                         |      1 |   3224 |    907 |00:00:02.19 |    7001 |    339 |   337K|   337K|  299K (0)|
    |*  2 |   TABLE ACCESS BY INDEX ROWID| a                       |      1 |   3224 |    907 |00:00:02.19 |    7001 |    339 |       |       |          |
    |*  3 |    INDEX SKIP SCAN           | IDX_XDT_N4              |      1 |  38329 |   6975 |00:00:02.08 |     330 |    321 |       |       |          |
    ------------------------------------------------------------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       2 - filter(("a"."XDT_CREATEDT"<=TO_DATE(' 2010-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
                  "a"."XDT_CREATEDT">=TO_DATE(' 2009-07-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss')))
       3 - access("a"."XDT_DOCOWNERPAYPK"=1202829132 AND "XDT_DOCTYPE"='PURCHASEORDER')
           filter(("a"."XDT_DOCOWNERPAYPK"=1202829132 AND "XDT_DOCTYPE"='PURCHASEORDER'))
    
    
     
    index idx_xdt_n4 details are as below.
    
    blevel   distinct_keys   avg_leaf_blocks_per_key   avg_data_blocks_per_key   clustering_factor       num_rows 
    3         868840             1                         47                     23942833              70224133
    Published by: 930254 on April 26, 2013 05:04

    the first query uses the predicate "XDT_DOCTYPE" = "PURCHASEORDER" to determine the order of the index IDX_XDT_N7, which needs to be scanned, and uses the other predicates to filter most of the index blocks. The second query uses an INDEX SKIP SCAN without consider the first column of the index IDX_XDT_N4 and use the predicates for the following columns ('a'. ("XDT_DOCOWNERPAYPK"= 1202829132 AND "XDT_DOCTYPE" = "PURCHASEORDER") to get a much more selective access (reading only 330 blocks instead of > 60 K).

    I think that there are two possible options to improve performance:

    1. If the creation of a new index is an option, you can define an index on the table A (xdt_doctype, xdt_docownerpaypk, xdt_createdt)
    2. If the creation of a new index is not an option, you can use an indicator of INDEX SKIP SCAN (INDEX_SS (an IDX_XDT_N4)) to order the CBO to use the second index (without a hint the CBO tends to ignore the possibility of using a SKIP SCAN in a join of NL). But with production advice is rarely a good idea... 11g you could you baselines sql to avoid these indications in the code.

    Concerning

    Martin

  • What I do when I get an error message indicating that my ID adobe was allowed too much time

    What I do when I get an error message indicating that my ID adobe was allowed too much time

    Hi Kjsoden,

    I found a thread that might help you: http://forums.adobe.com/thread/821424

    Let me know if this helped.

    Thank you

    Preran

  • A query that takes too much time with the dates?

    Hello people,
    I'm trying to pull some data using the status date, and for somereason its taking too long to return the data
       and trunc(al.activity_date) = TRUNC (SYSDATE, 'DD') - 1     --If i use this its takes too much time
    
    
      and al.activity_date >= to_date('20101123 000000', 'YYYYMMDD HH24MISS')
       and al.activity_date <= to_date('20101123 235959', 'YYYYMMDD HH24MISS') -- If i use this it returns the data in a second. why is that?
    
    How do i get the previous day without using the hardcoded to_date('20101123 000000', 'YYYYMMDD HH24MISS'), if i need to retrieve it faster??

    It seems that al.activity_date is indexed and is not TRUNC (al.activity_date). Your problem is not with the TRUNC(sysdate,'dd')-1. So use:

    and al.activity_date >= TRUNC(SYSDATE)-1
    and al.activity_date < TRUNC(SYSDATE)
    
  • I removed 3 SP in a continuous effort to 'fix' iexplore.exe to take too much time processor to do everything he does. Now I can't reinstall because of "access denied."

    original title: cannot re - install SP 3

    I removed 3 SP in a continuous effort to 'fix' iexplore.exe to take too much time processor to do everything he does.  Now I can't reinstall because of "access denied."  I have REMOVED all antivirus programs and malware and always get "access denied".  Need help!

    Don B

    Click HERE. Scroll down the page and click on the automated FixIt. Follow the prompts to run it. After that he did try to install the service pack that you downloaded from the source of IT.

  • I have a dell pc n series (Intel core duo) it take too much time starting last I started at 3: 00.

    Original title: problem in multidisciplinary

    I have a dell pc n series (Intel core duo) it take too much time starting last I started at 3 a.m. what will I do?

    you have eliminated the problems of virus/malware?

    have you recently installed on the computer or updated drivers, etc?

    See: http://windows.microsoft.com/en-au/windows/optimize-windows-better-performance#optimize-windows-better-performance=windows-7

  • I signed up for a year of 10 photos per month.  I am connected to adobe. I can't communicate with a real human being. I can't upload a picture to my computer. Mac 10.5.8. desktop computer. It takes too much time.

    I signed up for a year of 10 photos per month.  I am connected to adobe. I can't communicate with a real human being. I can't upload a picture to my computer. Mac 10.5.8. desktop computer. It takes too much time.

    Since this is an open forum, not Adobe support... you must contact Adobe personnel to help

    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)<=== note="" days="" and="">

    Don't forget to stay signed with your Adobe ID before accessing the link below

    Creative cloud support (all creative cloud customer service problems)

    http://helpx.Adobe.com/x-productkb/global/service-CCM.html

  • Problem with adding new storage to the CDV provider profile

    Hi all

    I have problem with adding new storage to the CDV provider profile.

    My ENV:

    VCD Version 5.5 latest

    vCenter 5.5

    VCDDB - SQL

    I created the environment with two profiles of storage for the first time and it's work well (the storage profile created before I joined the vCenter on the VCD)

    I created tags and he attributed to the data store and I see the new VM storage through the vSphere web client policy.

    I can also see VMS on the VCDDB the dbo.storage_profile_inv the new storage policy table and when I create new provider TDC I can't.

    What I'm trying:

    1 Refresh the storage via the VCD (right click on the attached vCenter) profile

    2. restart the inventory and the profile based on the vCenter servers

    3. restart the VCD and vCenter servers

    Help, please

    You can just follow KB 2075366.

  • Added new line at the top of tabular form in APEX 5.0 and universal theme (topic 42)

    Hello Apex Experts,

    When the user clicks on the button 'Add Row' a tabular presentation, I would like the new line to be at the top of the report rather than the bottom.


    I followed the instructions from Added new line at the top of table in APEX 4.0 form and Denes Kubicek demo application. But it does nothing, always create new bottom line.


    Anyone have an idea or an idea?


    Your help would be appreciated.


    Kind regards

    Blabla

    Hi all

    This problem is now solved by following the new blogpost of Dene:

    http://www.deneskubicek.blogspot.de/2015/05/tabular-form-add-rows-top-universal.html

    Kind regards

    Blabla

  • When a new tab opens the cursur button in the address bar to search and not the search engine

    When a new tab opens the cursor will move to the address bar to search and not to the search engine, I put to a new tab page.

    I went to about: config and changed keyword.enable to false. It works for the homepage at Firefox startup.

    How to disable the address for a new tab search, as I did for my homepage?

    sheilahsay

    Hello sheilahsay, maybe this addon works for you: https://addons.mozilla.org/firefox/addon/custom-new-tab/

  • I have been designing a new Web site and when I publish on BusinessCatalyst the index page shows a sign 'coming soon '? This has never happened before and I don't know how to solve this problem?

    I have been designing a new Web site and when I publish on BusinessCatalyst the index page shows a sign 'coming soon '? This has never happened before and I don't know how to solve this problem?

    I have published on an existing site, but also a new site, but I get the same message?

    Hello

    Open the page that wants to set as your home page,

    Click on more action-> set as start page

    Now visit the site again, it should be good.

    Let me know if you have any question.

Maybe you are looking for

  • Screen freeze and black screen with multiple windows problems

    Hey all,.I have problems with the release of screen when you run multiple windows (Chrome, office etc. etc.). When I try to switch between the windows, I get a gel and I am unable to do anything.The cursor can be seen moving around the screen, but ha

  • 320 GB external drive (PX1267E - 1 GB 32) under Linux

    Hello I just bought a Toshiba 320 GB external (PX1267E - 1 32 GB) disc and I need to work on Linux. Linux recognizes the drive as a SDA, but give an error of e/s with an impossible to read the partition table. No idea what is the problem? Can I use t

  • inoperative lights

    Or the power button on the top of the computer or HP logo at the front to turn it on Pavilion Elite HPE-400z. I don't remember if the two lights failed at the same time, but noticed that the two are is never on. My next stage command replacement for

  • Pavilion dv6tse - 3100: laptop screen turns sometimes and sometimes does not work

    When I turn on my laptop, there is a chance that the monitor does not light. What to do when this happens is I turn it works again and again until the screen lights up finally. When it lights up, it works very well and stays on until I turn it off an

  • Shockwave crash

    When I'm in a part of game on facebook I get shockwave crash can someone help please how to fix this