Kodo doing tablescan "select jdoclass from table "

Kodo is doing the following query on a table I am executing a query on, the
JDOCLASS field is not indexed (should it be ? It is not very unique, only 3
distinct records out of 800,000).
This tablescan takes about 8 minutes to complete..... any suggestions ? It
wasn't doing this a few days ago, not sure what I changed.
623 DEBUG [ExecuteThread: '13' for queue: 'default'] jdbc.SQL - [ C:733878;
T:
246214; D:4241176 ] preparing statement <1879730>: SELECT SYSDATE FROM DUAL
633 DEBUG [ExecuteThread: '13' for queue: 'default'] jdbc.SQL - [ C:733878;
T:
246214; D:4241176 ] executing statement <1879730>: (SELECT SYSDATE FROM
DUAL):
reused=1;params={}]
653 DEBUG [ExecuteThread: '13' for queue: 'default'] jdbc.SQL - [ C:733878;
T:
246214; D:4241176 ] preparing statement <5996885>: SELECT DISTINCT
CUSTOMERS.JDCLASS FROM CUSTOMERS
653 DEBUG [ExecuteThread: '13' for queue: 'default'] jdbc.SQL - [ C:733878;
T:
246214; D:4241176 ] executing statement <5996885>: (SELECT DISTINCT
CUSTOMERS.JOCLASS FROM CUSTOMERS): [reused=1;params={}]
Here's my EJB code:
public List searchByCustomerName(String custName)
PersistenceManager pm =
com.letsys.util.JDOUtil.getPersistenceManagerFactory().getPersistenceManager
Extent e = pm.getExtent(CustomerSummaryDTO.class, true);
Query q = pm.newQuery(e, "custName.startsWith(n)");
q.declareParameters("String n");
List result = (List)q.execute(custName);
return result;
Regards,
Chris.

A simple way to bypass this problem is by listing the persistent types.
http://solarmetric.com/Software/Documentation/2.5.3/docs/ref_guide_conf_kodo.html#com.solarmetric.kodo.PersistentTypes
Chris McCarthy wrote:
Kodo is doing the following query on a table I am executing a query on, the
JDOCLASS field is not indexed (should it be ? It is not very unique, only 3
distinct records out of 800,000).
This tablescan takes about 8 minutes to complete..... any suggestions ? It
wasn't doing this a few days ago, not sure what I changed.
623 DEBUG [ExecuteThread: '13' for queue: 'default'] jdbc.SQL - [ C:733878;
T:
246214; D:4241176 ] preparing statement <1879730>: SELECT SYSDATE FROM DUAL
633 DEBUG [ExecuteThread: '13' for queue: 'default'] jdbc.SQL - [ C:733878;
T:
246214; D:4241176 ] executing statement <1879730>: (SELECT SYSDATE FROM
DUAL):
reused=1;params={}]
653 DEBUG [ExecuteThread: '13' for queue: 'default'] jdbc.SQL - [ C:733878;
T:
246214; D:4241176 ] preparing statement <5996885>: SELECT DISTINCT
CUSTOMERS.JDCLASS FROM CUSTOMERS
653 DEBUG [ExecuteThread: '13' for queue: 'default'] jdbc.SQL - [ C:733878;
T:
246214; D:4241176 ] executing statement <5996885>: (SELECT DISTINCT
CUSTOMERS.JOCLASS FROM CUSTOMERS): [reused=1;params={}]
Here's my EJB code:
public List searchByCustomerName(String custName)
PersistenceManager pm =
com.letsys.util.JDOUtil.getPersistenceManagerFactory().getPersistenceManager
Extent e = pm.getExtent(CustomerSummaryDTO.class, true);
Query q = pm.newQuery(e, "custName.startsWith(n)");
q.declareParameters("String n");
List result = (List)q.execute(custName);
return result;
Regards,
Chris.
Steve Kim
[email protected]
SolarMetric Inc.
http://www.solarmetric.com

Similar Messages

  • Select count(*) from table in oracle 11g with direct path read takes time

    select count(*) from table takes long time, even more than couple of hours..
    direct path read is the wait event which is almost is at 99%..
    can u someone provide some info on this.. on solution.. thankx

    knowledgespring wrote:
    table has millions of records... 130 millions..
    select count(*) from BIG_SIZE_TABLE; --- executed in sql plus command prompt.
    Rows     Execution Plan
    0  SELECT STATEMENT   MODE: ALL_ROWS
    0   SORT (AGGREGATE)
    0    TABLE ACCESS   MODE: ANALYZED (FULL) OF 'BIG_SIZE_TABLE' (TABLE)
    Elapsed times include waiting on following events:
    Event waited on                             Times   Max. Wait  Total Waited
    ----------------------------------------   Waited  ----------  ------------
    SQL*Net message to client                       1        0.00          0.00
    enq: KO - fast object checkpoint                1        0.01          0.01
    Disk file operations I/O                       18        0.00          0.00
    direct path read                            58921        0.34        418.54direct path read time waited is : 58921 total time waited: 418.54
    That 418 seconds - not the hours you reported earlier. Is it possible that your connection to the database broke ?
    On a typical system, by the way, you can usually turn one direct read for tablescan into 1MB, so your scan seems to have covered about 59 GB, which seems to be in the right sort of ballpark for 130M rows.
    we have another query and when we test the query execution using v$sql, is_bind_sensitive =N, how to make is_bind_sensitive=Y all the time.. There is a hint /*+ bind_aware */ - I'd have to check whether or not it's documented at present. It might help.
    I would be interested in hearing why you think the hint should be bind sensitive when the optimizer doesn't.
    Regards
    Jonathan Lewis

  • Select data from table not in another table

    Hi,
    I want to select data from table A which is not in table B.
    Currently I am doing:
    select
    snoA,
    nameA,
    dobA
    from A
    where snoA not in
    (select snoB from A, B
    where snoA = snoB
    and nameA = nameB)
    But above is very slow.
    Can I do something like:
    select
    snoA,
    nameA,
    dobA
    from A, B
    where
    EXCLUDE ( snoA = snoB and nameA = nameB)
    Please note that I need the where condition on both the columns.
    any help will be appreciated.
    -- Harvey

    What are the approximate data volumes in A and B?
    What is "very slow"?
    What version of Oracle?
    What is the query plan?
    Without knowing anything about your system, my first thought would be to see if a NOT EXISTS happened to be faster for your data
    SELECT snoA,
           nameA,
           dobA
      FROM a
    WHERE NOT EXISTS (
        SELECT 1
          FROM b
         WHERE a.snoA = b.snoB
           AND a.nameA = b.nameB )Of course, I'm not sure why you are joining A & B in your NOT IN subquery. It would seem like you would just need a correlated subquery, i.e.
    SELECT snoA,
           nameA,
           dobA
      FROM a
    WHERE snoA NOT IN (
        SELECT snoB
          FROM b
         WHERE a.snoA = b.snoB
           AND a.nameA = b.nameB )That should be more efficient than the original query. The NOT EXISTS version may or may not be more efficient than the NOT IN depending on data volumes.
    Justin

  • How do I execute "Select count(*) from table " in OCI

    Hi,
    I am new to OCI and so this question may seem stupid. I would like to know how to execute the query "select count(*) from <table>" using OCI V8 functionality? Also after how do I get the result into a integer datatype? I have gone through most of the demo programs but is is of little help to me.
    Thanks in advance...
    Regards,
    Shubhayan.

    Hi,
    Here is sample code to give you some idea how to do it. If you want some more info let me know.
    Pankaj
    ub4 count;
    // Prepare the statement.
    char szQry = "SELECT count() FROM T1";
    if(OCI_ERROR == OCIStmtPrepare(pStmthp, pErrhp, (unsigned char*)szQry, strlen(szQry), OCI_NTV_SYNTAX , OCI_DEFAULT) )
         cout << "Error in OCIStmtPrepare" << endl;
         exit(1);
    // Bind the output parameter.
    OCIDefine *pDefnpp;
    if(OCI_ERROR == OCIDefineByPos ( pStmthp, &pDefnpp, pErrhp, 1,
    &count, sizeof(ub4), SQLT_INT,
    (dvoid *) 0, (ub2 *) 0, (ub2 *) 0,
                        OCI_DEFAULT) )
         cout << "Error in OCIDefineByPos" << endl;
         exit(1);
    if(OCI_ERROR == OCIStmtExecute(pSvchp, pStmthp, pErrhp, 1, 0, NULL, NULL, OCI_DEFAULT) )
         cout << "Error in OCIStmtExecute" << endl;
         exit(1);

  • Probel while selecting data from table

    Hi,
      As per my below code i want to select data from table AFKO  where  PLNBEZ = it_mat-matnr, and  GETRI  IS BLANK , but data is not comingin IT_AFKO
    **********************CODE
    select AUFNR RSNUM GAMNG PLNBEZ From AFKO into table it_afko for all entries in it_mat
                                                              where PLNBEZ = it_mat-matnr
                                                                and GETRI =  '  '.
    regards,
    zafar

    Hi,
    Try below code
    select AUFNR RSNUM GAMNG PLNBEZ From AFKO into table it_afko for all entries in it_mat
    where PLNBEZ = it_mat-matnr
    and GETRI = '00000000'.
    Hope you need the records for which GETRI is not updated.
    Regards
    Vinod

  • Can a procedure select data from tables on other schemas?

    Can a procedure select data from tables on other schemas?
    If it is posible, which syntax should I use to identify the tables and schemas on the SELECT query?

    Yes , it is possible..unless the current user has the right privileges on others' db objects schema.
    Now , as regards the syntax....
    1) The more descriptive way is to use the format ... <owner_schema>.<obj_name>.
    2) If you have declared public synonyms of other schema's objects then you can refer to them as just <obj.name>.... but the <owner_schema>.<obj_name> is not wrong.
    3) If the db objects reside on another database you must have declared a db link.... then the syntax is <owner_schema>.<obj_name>@<db_link_name>.
    Regards,
    Simon

  • Select values from table%ROWTYPE variable into a cursor

    I have a stored procedure which has an OUT parameter of table1%ROWTYPE.
    In future we might have to add more OUT parameters of table2%ROWTYPE etc. But at any point of time only one will have values.
    So instead of having table%ROWTYPE as OUT parameter, can I send these single row ( with variable values) in a cursor, so that declaration part atleast will not change.
    Is it possible to select values from table%ROWTYPE variable into a cursor.
    cursorOUT IS
    SELECT * FROM varREC;
    where varREC is table.ROWTYPE variable.
    Or which is the better solution in this situation.
    Thanks.

    SQL> var a refcursor
    SQL> declare
      2   bb emp%ROWTYPE;
      3  begin
      4   select * into bb from emp where rownum = 1;
      5   open :a for select bb.ename ename, bb.empno empno from dual;
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    SQL> print a
    ENAME                                 EMPNO
    SMITH                                  7369Rgds.

  • Select aentries from table Z-Table for all sales order line items

    Hi friends,
    can anyone please explain me about the "Select entries from table Z-Table for all sales order line items".
    Thanks.

    Moderator message - Welcome to SCN.
    But
    Moderator message - Please search before asking. Press F1 on SELECT and look at the FOR ALL ENTRIES addition. - post locked             
    Rob

  • Select data from table where field is initial

    I have table that has 10 million records.
    I want to select data from this table where certain date field is blank.
    *SELECT * FROM table*
    INTO TABLE internal table
    WHERE PSTNG_DATE = BLANK.
    Does anybody know how to select data from data base table when certain field is blank.
    I cont select all data once and delete which i dont want, the table is big, it will blow up app server.
    thanks in advance,
    Sachin
    Moderator: Pls do not lock the posting instead provide me the link, its disrespecting.

    Respect the forum rules and common sense, and you will be respected.
    "how to select data from a database table when the field is blank" is very basic, and basic questions will be locked, because they have been asked many times and you can find the answer yourself with a little effort. There is nothing disrespectful about it.
    Thread locked.
    Thomas

  • Heterogeneous Connectivity: Error when select data from table

    Hi all,
    I use Heterogeneous Connectivity in Oracle 10g Linux to connect SQL server Database. I use FeeTDS ODBC driver. After configuration, I create database link in Oracle, Database link is active.
    But in SQLplus, I write: select * from all_catalog@DBL; It views all tables and views in sql server database.
    When I write: select * from AA@DBL; It produce error:
    ORA-00942: table or view does not exist
    [Generic Connectivity Using ODBC]Record AA has no fields. Loading failed
    ORA-02063: preceding 2 lines from DBL
    Please help me. Thank you very much!

    I am sorry, i did not go through the entire message of yours
    Does AA exist, does not contain columns, describe the table please.
    Maybe you should not try Select * from ,,,, rather Select specific fields.. Also if in the remote database, the field and tablename are written in lower case you may want to try
    select "field_name" , from "aa" etc
    ammar sajdi

  • How to get selected row from table(FacesCtrlHierBinding ).

    I'am trying to get selected row data from table:
    FacesCtrlHierBinding rowBinding = (FacesCtrlHierBinding) tab.getSelectedRow();
    Row rw = rowBinding.getRow();
    But import for oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding cannot be found from my JDev 11.
    What is correct package for FacesCtrlHierBinding?

    Hi, another problem.
    I fill table with data manualy from source:
    <af:table var="row" value="#{getCompanyData.com}"
    rowSelection="single" columnSelection="single"
    editingMode="clickToEdit"
    binding="#{getCompanyData.tab}"
    selectionListener="#{getCompanyData.GetSelectedCompany}">
    <af:column sortable="false" headerText="col1">
    <af:outputText value="#{row.id}"/>
    </af:column>
    <af:column sortable="false" headerText="col2">
    <af:outputText value="#{row.name}"/>
    </af:column>
    <af:column sortable="false" headerText="col3">
    <af:outputText value="#{row.phone}"/>
    </af:column>
    </af:table>
    and when I'am trying to use method to get selected row:
    RichTable table = this.getTab(); //get table bound to UI Table
    RowKeySet rowKeys = table.getSelectedRowKeys();
    Iterator selection = table.getSelectedRowKeys().iterator();
    while (selection.hasNext())
    Object key = selection.next();
    table.setRowKey(key);
    Object selCompany = table.getRowData();
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding) selCompany;
    row = rowData.getRow();
    I got an error:
    SEVERE: Server Exception during PPR, #1
    javax.el.ELException: java.lang.ClassCastException: data.COMPANY cannot be cast to oracle.jbo.uicli.binding.JUCtrlHierNodeBinding
    When I created tables by dragging data from date control, all worked fine.
    What could be a problem?

  • Selecting date from table of type c.

    hi,
    i have a field  in table type c.......the field contain date in fallowing format 02.07.2007 ,if i have to write a select query for that table ,for selecting all entrie between two dates ...how can i do.....
    note : date in the table is of type char.i cant change the table type it is standard.i now the lenght process.please suggest me the short format

    Check if below code can give you some lead:
    PARAMETERS: p_date1 TYPE datum,
                p_date2 TYPE datum.
    DATA: l_date1 TYPE char10,
          l_date2 TYPE char10.
    START-OF-SELECTION.
      CONCATENATE: p_date1+6(2) p_date1+4(2) p_date(4) INTO l_date1
                      SEPARATED BY '.',
                   p_date2+6(2) p_date2+4(2) p_date(4) INTO l_date2
                      SEPARATED BY '.'.
      SELECT <fld1> <fld2> ...
             INTO <itab>
             FROM <table>
             WHERE date bt (l_date1, l_date2)
             AND...

  • How do you select data from tables not in the Properties table list?

    Hi I am new to SAP B1.
    I am amending the production order and wish to add fields from the Bill of Materials table Itt1.  However this table is not in the list of tables for this report.
    1. Do I have to redo the whole report in Crystal or is there a way of using the PLD report?
    2. This table join needs to have 2 fields in the join the father and the child item codes.  How many joins can the PLD report look after?  I assume that Relate to is the first join and next segment is a second join.  Am I right or not as I have been unable to find any reasonable documentation on creating and maintaining PLD reports.
    3. Where can I find information if any on System Variables and what data they represent?
    Thanks
    Chris

    Hi Cris,
    welcome to Sdn forum!
    For question 1, i think you can do this using pld.
    For question 2, to be able to view other tables, you will need to hold the ALT button and press the database table(Properties section on the lower right portion of the PLD screen), you can now view other tables. then to join other tables you will need to RELATE to and Next Segment, you can also find this under Properties and go to Content Tab.
    for question 3, you will need to create a query that will lead you to the exact field name, say for example SELECT Price from POR1, this price is actually variable 81 from purchase order line and the equivalent value is the por1.price..
    Regards,
    Darius Gragasin

  • Select LONG_RAW from table.

    I've got a table with a column of long_raw datatype.
    Whenever I'm selecting data from that table it displays (blob)
    I need to get the data out of the column through pl/SQL
    1. why is it saying (blob) when the column is of long_raw datatype?
    2.Can I select the content from a long_raw column and display it?
    Regards,
    Satrajit

    you need to use the oracle built-in package UTL_RAW. here are some examples:
    SQL> create table sample_long_raw
      2  (long_msg long raw);
    Table created.
    SQL> describe sample_long_raw;
    Name                                      Null?    Type
    LONG_MSG                                           LONG RAW
    SQL> insert into sample_long_raw
      2  values ('hello');
    values ('hello')
    ERROR at line 2:
    ORA-01465: invalid hex number
    SQL> insert into sample_long_raw
      2  values (utl_raw.cast_to_raw('hello'));
    1 row created.
    SQL> select * from sample_long_raw;
    L
    6
    SQL> create or replace function get_long_raw (row in rowid) return varchar2 is
      2      longhold    varchar2(4000);
      3  begin
      4   for r in (select LONG_MSG from sample_long_raw where rowid = row) loop
      5    longhold := utl_raw.cast_to_varchar2(r.long_msg);
      6   end loop;
      7  return longhold;
      8  end;
      9  /
    Function created.
    SQL> select get_long_raw (rowid) from sample_long_raw;
    GET_LONG(ROWID)
    hello
    SQL> hope this helps.

  • How to save the selected records from Table control in dialog programming

    Hiiiiiiii Every1
    Actually the problem is like this:-
    I have to select some records from table control and then want to save the selected records in DB table.
    Example
    I have some rows having inforamtion bout employees...
    Now what i want is that when i click on 'SAVE' button then these selected rows should be moved into DB table.
    Sachin Dhingra

    see below example, I have added INSERT option after DELETE option.
    REPORT demo_dynpro_tabcont_loop_at.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA cols LIKE LINE OF flights-cols.
    DATA: ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    DATA: itab TYPE TABLE OF demo_conn.
    TABLES demo_conn.
    SELECT * FROM spfli INTO TABLE itab.
    LOOP AT flights-cols INTO cols WHERE index GT 2.
      cols-screen-input = '0'.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
    ENDMODULE.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE read_table_control INPUT.
      MODIFY itab FROM demo_conn INDEX flights-current_line.
    ENDMODULE.
    MODULE user_command_0100 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'TOGGLE'.
          LOOP AT flights-cols INTO cols WHERE index GT 2.
            IF  cols-screen-input = '0'.
              cols-screen-input = '1'.
            ELSEIF  cols-screen-input = '1'.
              cols-screen-input = '0'.
            ENDIF.
            MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDLOOP.
        WHEN 'SORT_UP'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
            cols-selected = ' '.
            MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'SORT_DOWN'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
            cols-selected = ' '.
            MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'DELETE'.
          READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
          IF sy-subrc = 0.
            LOOP AT itab INTO demo_conn WHERE mark = 'X'.
              DELETE itab.
            ENDLOOP.
          ENDIF.
        WHEN 'INSERT'.
          READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
          IF sy-subrc = 0.
            LOOP AT itab INTO demo_conn WHERE mark = 'X'.
              itab1 = itab.
              modify itab1.
            ENDLOOP.
          ENDIF.
          if not itab1 is initial.
            INSERT dbtab FROM TABLE itab1.
          endif.
      ENDCASE.
    ENDMODULE.

Maybe you are looking for

  • Error in Interfacing Project Invoices to AR - No Active Project Manager

    I am getting an error while transferring a projects invoice to AR. I am running concurrent program 'PRC: Interface Invoices to Receivables' program from a responsibility that was created as per the client project security requirements. The output  gi

  • Windows 2008 r2 sp1 installation error 0x800f081f

    I have two servers that are nearly identical running Windows 2008 R2.  Both are Hyper-V hosts.  I have applied SP1 to one of them, but am having problems getting SP1 to install on the 2nd one.  The downloaded installation fails with 0x800f081f.  I ha

  • PRINT SPOOL TO NETWORK PRINTER

    Hello All,   I am working on scheduling Mass Activity Jobs using CPS. I am currently trying to use CPS to run the SAP_ABAPRUN definition. I have a requirement to print the output of the spool to a local printer. I have imported the output devices and

  • No private E-Mail option

    I earn an BlackBerry 8520. I tried to install some private email adresses. Using the setup wizard in the menue appears only the choice for a work email with a BlackBerry enterprise server. What to do? Solved! Go to Solution.

  • FileVault stuck on encrypting

    I foolishly tried to enable FileVault and now it is completely stuck on "Estimating time remaining" for 2 days. It became stuck quite fast as it gave me an error a minute or two in, but it won't stop now though... I checked the status in Terminal and