The question of performance - cached data from a large table

Hi all

I have a general question about caching, I use an Oracle 11 g R2 server.

I have a large table on 50 million lines, which is very often consulted by my application. Some query runs slowly and some are ok. But (of course) when the data in the table is already in the cache (so basically when a user asks the same thing twice or several times) it works very quickly.

Does anyone have any recommendations on the caching of data / table of this size?

Thank you very much.

Chiwatel wrote:

With the best formatting (I hope), I'm sorry, I'm not used to the new forum!

Hash value of plan: 2501344126

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

| ID | Operation | Name | Begins | E - lines. E - bytes | Cost (% CPU). Pstart. Pstop | A - lines.  A - time | Pads | Bed |  OMem |  1Mem | Used Mem.

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

|  0 | SELECT STATEMENT |                    |      1.        |      |  7232 (100) |      |      |  68539 | 00:14:20.06 |    212K |  87545 |      |      |          |

|  1.  SORT ORDER BY |                |      1.  7107 |  624K |  7232 (1) |      |      |  68539 | 00:14:20.06 |    212K |  87545 |  3242K |  792KO | 2881K (0) |

2.  NESTED LOOPS |                |      1.        |      |            |      |      |  68539 | 00:14:19.26 |    212K |  87545 |      |      |          |

|  3.    NESTED LOOPS |                |      1.  7107 |  624K |  7230 (1) |      |      |  70492 | 00:07:09.08 |    141K |  43779 |      |      |          |

*  4 |    INDEX RANGE SCAN | CM_MAINT_PK_ID |      1.  7107 |  284K |    59 (0) |      |      |  70492 | 00:00:04.90 |    496.    453.      |      |          |

|  5.    RANGE OF PARTITION ITERATOR.                |  70492 |      1.      |    1 (0) |  KEY |  KEY |  70492 | 00:07:03.32 |    141K |  43326 |      |      |          |

|*  6 |      INDEX UNIQUE SCAN | D1T400P0 |  70492 |      1.      |    1 (0) |  KEY |  KEY |  70492 | 00:07:01.71 |    141K |  43326 |      |      |          |

|*  7 |    TABLE ACCESS BY INDEX ROWID | D1_DVC_EVT |  70492 |      1.    49.    2 (0) | ROWID | ROWID |  68539 | 00:07:09.17 |  70656 |  43766 |      |      |          |

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

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

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

4 - access("ERO".") MAINT_OBJ_CD '= 'D1-DEVICE' AND 'ERO'." PK_VALUE1 "=" 461089508922")

6 - access("ERO".") DVC_EVT_ID '=' E '. ("' DVC_EVT_ID")

7 filter (("E". "DVC_EVT_TYPE_CD"= "END-GSMLOWLEVEL-EXCP-SEV-1" OR "E" " DVC_EVT_TYPE_CD "=" STR-GSMLOWLEVEL-EXCP-SEV-1'))

Your user name has run a query to return the lines 68 000 - what type of user is, a human being cannot cope eventually with that a lot of data and it's not entirely surprising that he might take a long time to return.

One thing I would check is if you still get the same execution plan - Oracle here estimates are out by a factor of about 95 (7 100 vs 68 500 returned planned lines) may be a part of your change in the calendar refers to plan changes.

If you check the numbers you will see about half your time came to survey the unique index, and half visited the table. In general, it is hard to beat Oracle to cache algorithms, but the indexes are often much smaller than the paintings they cover, so it is possible that your best strategy is to protect this index at the expense of the table. Rather than trying to create a cache to KEEP the index, however, you MIGHT find that you get some advantage to create a cache of RECYCLING for the table, using a small percentage of available memory - the goal is to arrange things so that the table blocks that you revisit do not grow the index blocks that you will come back to memory.

Another detail to consider is that if you visit the index and the table completely random (for 68 500 sites), it is possible that you find yourself re-reading blocks several times during the visit. If you order the intermediate result set of driving all table first you find you're walk the index and the table in the order and that you don't have to reread all the blocks. It's something that only you can know, however.  The code will have to change to include a view of inline with a dash of no_merge and no_eliminate_oby.

Concerning

Jonathan Lewis

Tags: Database

Similar Questions

  • What is the best strategy to migrate data from Windows to one Mac to another? I use Parallels Desktop to run Windows on my current Mac but want to use Bootcamp on my new.

    What is the best strategy to migrate data from Windows to one Mac to another? I use Parallels Desktop to run Windows on my current Mac but want to use Bootcamp on my new.

    If it is only the data (not apps) I use Dropbox. It turned out to be the best way to move things between the side Mac and the bootcamped Windows of my iMac side. I don't see why it would not work to move data from a virtual machine installation of Win to a BootCamp installation.

  • I used the migration assistant to transfer data from my pc windows for my macbook pro, and it erased all my data. Is he here to retrieve these data

    I used the migration assistant to transfer data from my laptop to windows xp for my macbook pro OS X Yosemite 10.10.5 version and she erased all the data on my mac iTunes i.e., photos, documents, games, etc. Is it possible to recover these data or take it back to a State of pre migration? If not can I erase it and reload the software from scratch?

    Thank you

    Dave has

    You have a backup of Mac before moving the data from the PC?

  • With the help of the socket object to retrieve data from web application without the html files

    I tried to use the socket object to retrieve data from a web application (I just control script version vs version online). So all I want to do is access http://hyle.io/version that returns me the current version of the application (such as a simple string) in order to compare it in my script and then notifies the user accordingly. I have just a few problems using the socket object. I used this code from the Adobe Javascript Tools Guide:


    reply = "";
    conn = new Socket;
    // access Adobe’s home page
    if (conn.open ("www.adobe.com:80")) {
    // send a HTTP GET request
    conn.write ("GET /index.html HTTP/1.0\n\n");
    // and read the server’s reply
    reply = conn.read(999999);
    conn.close();
    }
    

    ... that I then adapted as:

    reply = "";
    conn = new Socket;
    if (conn.open ("hyle.io:80")) {
      conn.write ("GET /version HTTP/1.0\n\n");
      reply = conn.read(999999); 
      conn.close();
    }
    

    And here is what I get:

    HTTP/1.1 400 Bad Request
    Content-Length: 225
    Content-Type: text/html
    Server: Pagodabox-Routing-Mesh
    
    

    Bad Request

    Your browser sent a request that this server could not understand.

    Résultat : true

    I don't know a lot about HTTP requests, but I wondered if it was related to the fact that I am not pointing to a specific HTML file and the type of request was wrong or if I should rather check if there is something wrong with my host?

    The site/app is PHP and is hosted on PagodaBox if it helps.

    Thanks in advance!

    Hi Sebastien Lavoie,

    It should work

    var HTTPFile = function (url, port) {}

    If (arguments.length == 1) {}

    URL = arguments [0];

    port = 80;

    };

    This.url = url;

    This.port = port;

    this.httpPrefix = this.url.match(/http:\/\//);

    This.Domain = this.httpPrefix is nothing? This.URL.Split("/") [0] + ":" + this.port: this .url .split ("/") [2] +":" + this.port;

    This.Call = ' GET ' + (this.httpPrefix == null? ' "). " http://" (+ this.url: this.url) + "HTTP/1.0\r\nHost: ' + (this.httpPrefix is nothing? "This.URL.Split("/ ") [0]: this .url .split (" / ") [2]) +" \r\nConnection: close\r\n\r\n ";

    This.Reply = new String();

    This.Conn = new Socket();

    This.Conn.Encoding = "binary";

    HTTPFile.prototype.getFile = {function (f)}

    var typeMatch = this.url.match(/(\.) (\w{3,4}\b)/g);

    If (this.conn.open (this.domain, "binary")) {}

    This.Conn.Write (this.) Call);

    This.Reply = this.conn.read (9999999999);

    This.Conn.Close ();

    } else {}

    This.Reply = "";

    }

    (Return this.reply.substr(this.reply.indexOf("\r\n\r\n")+4);

    };

    }

    Hyle var = new HTTPFile ("http://hyle.io/version");

    Alert (hyle. GetFile());

    And by the way, I like the idea of 'http://hyle.io'. Can you give me your email address, I want to learn more about this Web site.

    Please send me an email to [email protected]

  • What is the best solution to recover data from dead iPhone and no backup?

    Hello

    My iPhone won't turn n load. I search on google and read the article of more than 200 and try all the way but did not turn on iPhone. I can connect to the iPhone in DFU mode and iTunes has detected an iPhone in recovery mode. Popup message you must restore this iPhone before it can be used with iTunes.

    If I click this, it warns me that factory settings will be restored and that the data will be lost. I don't want to lose my data. I don't have a backup.

    I'm apple showroom that the guy told me having hardware problem.

    If I restore the iPhone in recovery mode don't know not can be restored successfully without any problem and iPhone turns on but the apple guy told me is hardware problem if hardware problem then how to restore the iPhone in recovery mode?

    I take the iPhone to other stores after they checking all the iPhone, they say can't fix. Some say that the problem of CPU card or the card mother or logic.

    Let's start the discussion.

    Option

    1. I saw on the video, some expert people can get out of the iPhone very easy memory chip.

    Question:

    A. after getting out the memory of my iPhone chip can possible backup on my computer?

    B. can save on my car iCloud account?

    C. they can restore my data to the new iPhone?

    D. is possible without leaving the logic memory chip Board can backup to my computer or iCloud drive?

    2 buy second hand iPhone then ask them take out my iPhone memory chip and put it in the second hand phone.

    Question: After they change the chip memory then second phone show all applications and data? If the iPhone works this way and then also can backup on iCloud Drive?

    3. If have Logic Board problem, then I change the logic board so my chip memory data put on my logic board.

    Issues related to the:

    A. where can I buy Logic Board iPhone 6 more than 64 GB?

    B. iPhone show all apps and data?

    C. can save on my iCloud drive?

    Someone said: he pointed out that it is a small chip on the logic board are common to move on and stop your iPhone from powering on or even charge he did repair today and walla it back I honestly thought that the phone had it but 100% is the question its caused by overcharging.

    Questions: What chip on the logic board?

    I have download where I save the data because many apps account that apps had no backup service. I have data retrospective get.

    If another option available please share here to help others.

    I already spend 15 days on research and to read the article and wasting my time. Hope may soon find a way to recover the data.

    Thank you very much

    Apple does not sell to all parts of the iPhone. The only way you will get an iPhone logic board, is buying a recovered on another phone.

    The iPhone is not serviceable by the user.

    If you have not been back, the chance you will be able to recover your data is almost zero. You must back up before something goes wrong, not after.

  • create the http client to retrieve data from web service

    Hello

    I am newbie on our webworks. I need to retrieve data from web service. How to connect to this service and analyzed. There is a tutorial that can help me get started with it.

    Can any one advice me how can I start working with webworks on blackberry 10

    Thanks for any help

    In general, you will need to use an AJAX call to the server

    It really depends on what the server returns as to how the information is easy to digest

    JQuery provides a simple interface, and returns information easy to use

    If you deal with things gets complicated XML according to namespace

    If you look at the raw XML data and it goes something like fred: name you will have questions requiring an implementation of SAX - JSON is simple if you don't get that even if (nothing too confusing here)

    If using an external data source JSON go if you have the choice

    As examples go - just look to the top of JQuery Ajax [JSON / XML] and you will get where you're going quickly

    SAX is MUCH harder because of the namespace - Dublin is the most common and same XML without namespace is not simple to handle, so avoid it if you can

  • How transform the trailing spaces & AREAS of data from sybase to oracle

    Helllo,

    We are the migration of data from sybase to Oracle using goldengate... Source Sybase with SPACES (single / Multiple) as data to CHAR/VARCHAR that will be migrated to the VARCHAR2 data type in Oracle. I'm having trouble trying to implement under two conditions to transform the data

    1) Remove SPACES during the IPL for CHAR/VARCHAR

    example: Data Source: "TRAILING SPACE.

    Given target expected - remove the spaces of trailinging: "TRAILING SPACE.

    2) If the data with SPACES like a value (single or Multiple) will be loaded as a single SPACE in Oracle.

    example : Source data                                                  :  "          "

    Expected data from target - unique space:

    Map: dbo. Target TEST_TABLE DEV01. Table_test, COLMAP (USEDEFAULTS, CRE_ID = @IF (@STRRTRIM (CRE_ID) = @NULL AND CRE_ID <>@NULL, ' ', @STRRTRIM (CRE_ID)));

    I tried above mapping in the settings file, but it returns error like below, guidance on the highest implementation requirement will be useful.

    ... RIM (CRE_ID) = @NULL AND CRE_ID...

    ^

    Error in the COLMAP clause. Invalid function or argument.

    Under column mapping is worked :-)

    Map: dbo. Target TEST_TABLE DEV01. TABLE_TEST, COLMAP (USEDEFAULTS, CRE_ID = @IF (@STRLEN (@STRTRIM (CRE_ID)) = 0, ' ', @STRRTRIM (CRE_ID)));

  • I want to loop through the data from two different tables using for loop where the query should be replaced at runtime, please help me

    I have the data into two table with the structure of similar column, I want to loop through the data in these two tables

    based on some condition and runtime that I want to put the query in loop for example, the example is given, please help me

    create table ab (a number, b varchar2 (20));

    Insert into ab

    Select rownum, rownum. "" sample "

    of the double

    connect by level < = 10

    create table bc (a number, b varchar2 (20));

    Insert into BC.

    Select rownum + 1, rownum + 1 | "" sample "

    of the double

    connect by level < = 10

    declare

    l_statement varchar2 (2000);

    Boolean bool;

    Start

    bool: = true;

    If it is true, then

    l_statement: =' select * ab ';

    on the other

    l_statement: =' select * from bc';

    end if

    I'm in execute immediate l_statement - something like that, but I don't know

    loop

    dbms_output.put_line (i.a);

    end loop;

    end;

    Something like that, but this isn't a peace of the code work.

    Try this and adapt according to your needs:

    declare

    l_statement varchar2 (2000);

    c SYS_REFCURSOR;

    l_a number;

    l_b varchar2 (20);

    Boolean bool;

    Start

    bool: = true;

    If it is true, then

    l_statement: = "select a, b, AB;

    on the other

    l_statement: = "select a, b from bc;

    end if;

    --

    Open c for l_statement;

    --

    loop

    extract the c in l_a, l_b;

    When the output c % notfound;

    dbms_output.put_line (l_a |') -' || l_b);

    end loop;

    close c;

    end;

    /

  • Cannot find the file error when loading data from text file to Oracle

    Hello

    I have an interface where I am loading a data from the text file to Oracle.
    But when I try to do that I am getting following error.

    ODI-1227: SrcSet0 (load) task fails on the source FILES SAPMM connections.
    Caused by: java.sql.SQLException: file not found: d:/mdb/#General.get_filename
    to com.sunopsis.jdbc.driver.file.FileResultSet. < init > (FileResultSet.java:160)
    at com.sunopsis.jdbc.driver.file.impl.commands.CommandSelect.execute(CommandSelect.java:57)
    at com.sunopsis.jdbc.driver.file.CommandExecutor.executeCommand(CommandExecutor.java:33)

    SAPMM is the name of the connection.
    I use get_filename to get the name of the file and it is fetching a correct value as long as this variable is updated in the previous stage of this interface.
    KM, used for loading is SQL file

    What would be the cause of this error?

    Thank you
    Mahesh

    Also a single query would be ok if I'm moving only generated package (according to your scenario3) scenario and not UI? It running properly?

    Yes... It runs successfully

  • Using the calendar function to select and read data from MS access tables?

    Hello

    I woke up in the learning of database in no time. I'm using Labview 9 to create a table based on DDMMYY hhmmss format. I can write data to the table in access. The picture will be 24 hours before a new table will be created. However, I find that this concept is not very gd as time goes by, I'll have a lot of paintings for example after 6 months.

    1.I would like to create a calendar (similar to the system clock) in labview, through which the user can click and select, which will then open and retrieve the data. Inorder to do I think I need to create queries and the relationship in MS Access? can any1 advice? Please give as much detail as possible.

    2.i can access data and display in labview. However, I want to display the data and plot in the chart. For instance, coloum b, c and trace on the graph in a proceeding for the analyst.

    3. how to generate a report to an email in a file to document the daily data inserted. I can do it in labview?

    Any help would be much appreciated.  If you have examples of code and don't mind not to share, I would be very grateful.

    Thanks 1million


  • How to create views of data from different databases tables in2

    Using Oracle 10.2 g

    I have 2 databases Gus and the haggis on schema Comqdhb.

    Glink indicates a link of database between Haggis and Gus

    In Gus, there is school that contains columns with same name upn, grade, subject, student of tables...

    STUDENT
    UPN
    academicYear

    Object

    Object

    GRADE
    examlevel
    grade

    SCHOOL
    SN

    In HAGGIS raising tables, grade, teacher containing columns upn... desc below.

    STUDENT
    UPN

    GRADE
    grade
    UPN
    academicyear
    level



    Create views in your database HAGGIS who join their all the qualities of the review. You should have a point of view that will produce the following relationship:
    examGrade (upn, subject, examlevel, sn, rank, academicYear)

    So I need to create a view that gets the data from the tables in the databases.

    create view as examGrade (upn, subject, examlevel, sn, rank, academicYear) like some s.upn


    But I don't get the selection of a column of 2 tables in different databases

    I mean if I said

    Select the UPN in comqdhb.student@glink,comqdhb.student;
    Select the upn name in comqdhb.student@glink,comqdhb.student
    *
    ERROR on line 1:
    ORA-00918: column ambiguously defined

    Help me, thank you.

    Hello

    Rider wrote:
    The issue is that I can't understand that I should create the view by the union of the haggis and the two gus data or only haggis.
    the reason I believe I need to combine the two is mentioned * "" create views in your database schema HAGGIS who join their all the qualities of the review. ". *
    By the mention of creating views and who join their all the qualities of the review, it probably means to obtain the data of the GUS and HAGGIS.

    This is my interpretation of the assignment, too.
    If you ask just the tables on Gus, you will get the ranks of three of the four schools: it's not all examination classes.
    If you ask just the tables on Haggis, you will get the ranks of any of the four schools: it's not all examination classes.

    2nd prob is that if have decided to create a view that gets the data from these two gus and therer haggis would be a lot of duplication involved due to the cross product

    Why would there be "repetition involved due to the cross-product"?
    If the quuery of Gus produces 100 lines, the request of product Haggis 30 rows, then the UNION of the two will have 100 + 30 = 130 lines (assuming, as you say, each student is at school only one).

    the query I wrote is

    Create view examGrade (upn, subject, examlevel, sn, rank, academicYear)
    as
    Select distinct s.upn as upn, g.subject as topic,
    g."LEVEL" as examlevel, g.grade as rank, to_number (g.academicyear) as academicyear
    of s comqdhb.student, comqdhb.grade g
    s.UPN, sb.subject, g.elevel, g.grade, s.acyr select Union
    of comqdhb.subject@glink sb,comqdhb.student@glink s,comqdhb.gradevalues@glink g;

    You should not write, not to mention not formatted zip code. I have a little time I can devote to answering questions in the forum. Do you want me
    b spend this time formatting your code, so I can understand the question, and no time to answer, or
    b spend only a little time reading understanding your code and spend most of my time to help you?
    I would prefer (b), but the choice is yours.
    See the statement that I posted in my last post for an example of the formatted code. You see how it appears in a box with a police fixed-width, and multiple spaces are printed? This is because I typed {code} (all small letters), before and after the section I wanted formatted.

    At least put each table in the FROM clause on a separate line, so it is easy to know if you have enough join conditions.
    If you have N tables in the FROM clause, you almost always have at least N-1 join conditions that specify how the tables are linked together. For example, if talk you about two tables, quality and student, you expect to see a join condition that tells you when you have data in a table, how to find related data in the other table, such as

    g_gus.upn = s_gus.upn
    

    No no no join conditions will cause "repetition involved due to the cross product.

    I downloaded my info here
    http://www.upload4free.com/download.php?file=44201983-School_ExamGrades.PDF


    http://www.upload4free.com/download.php?file=184648736-ExamGrades_Case_Study_2008FINAL.PDF

    Sorry, if there is data as long as you can't post here, there is much too much for me to read.
    Make a sample set, containing a few (maybe five) students and a few shades of each student. It is fine to copy a few lines of your actual data.

    That's all the time I have for today. I can't wait to get the data and formatted requests.

  • How to get data from a database table and insert into a file

    Hello
    I'm new to soa, I want to create an xml with the data from database tables, I'll have the xsd please suggest me how to get the data in the tables and insert in a file
    concerning

    in your bpel process, you can use the db adapter to communicate with the database.
    with this type of adapter, you can use stored procedures, selects, etc to get the data from your database into your bpel workflow.

    When did it call in your bpel to the db adapter process it will return an output_variable with the contents of your table data, represented in a style of xml form.

    After that, you can use the second card (a file synchronization adapter) to write to the content of this variable in output to the file system

  • Java code to extract data from a custom table to form

    I need to transfer data from one table to the form. Please provide the java method to do this. The table has 4 columns. I need to fill in all the data form as level. It will be a great help if sombody can provide the same java code and the logic of xpress to achieve the same.

    Please refer to the documentation for the com.waveset.util.JdbcUtil API. The class has functions for the features you need.

  • Download data from an external table with a where clause clause

    Hello

    How can I insert data in an external table into a table already created in the database where person_id = person - _id on the external table?

    Example:

    External table
    XX_EXTERNAL_TBL (Person_id, emp_number, emp_name)
    Internal table
    XX_SQL_LOADER_TEST (Person_id, emp_number, emp_name)
    ID of the person already exists on the inner table (want only the last column to import where the ID of the person are the same)


    Thank you

    You talk of * 'Update' * (Fanfarrias y tambores)

    Update XX_SQL_LOADER_TEST SLT
    Set emp_number = (SELECT emp_number from XX_EXTERNAL_TBL WHERE AND.) Person_id = HI. PERSON_id)
    , emp_name = (SELECT XX_EXTERNAL_TBL emp_name AND where AND.) Person_id = HI. PERSON_id)

  • Load data from an intermediate table into a real table by using the value of the indicator

    I need a code quick and dirty pl/sql to read the intermediate table ' STG_TABLE, line by line and load data into a PROD_TABLE.» The load should fail altogether, is a restoration should occur when he there an error occurs during registration to insert into a table of production using a flag value of Y as outcome and N as a failure.
    Any suggestions?

    Hello

    It seems that if you want something like:

    BEGIN
        :ok_flag := 'N';
        INSERT INTO  prod_table (col1, col2, ...)
         SELECT               col1, col2, ...
         FROM     stg_table;
        :ok_flag := 'Y';
    END;
    

    RESTORATION is done automatically in case of error.

    Instead of a link to ok_flag variable, you can use another type of variable that is defined outside the scope of this PL/SQL code.

    Published by: Frank Kulash, June 5, 2012 22:47

Maybe you are looking for