Fastrer BSEG table access

hi experts,
               As v have FM for faster VBFA table access, is there any FM for faster BSEG table access or any othere method as BSEG takes longer time to access.
Thanks.
Khan

Can you clarify the business requirement a little more? - the Special GL indicator of "A" indicates you are interested in customer or vendor Downpayments, but you also want " " - and you mention BSAS & BSIS which are for GL postings, not Customer nor Vendor...?
Jonathan
p.s. BSID / BSAD & BSIK / BSAK do have the Special GL indicators in the keys
Edited by: Jonathan Coleman on Apr 9, 2008 4:32 PM

Similar Messages

  • Error while activating the BSEG table

    hi guys ,
                today i joined SAP SCN . I have this error
    First i appended a structure of 5 fields in BSEG table .Then i tried to delete this append structure.
    But while deletiing it took nearly 20-25 minutes to process and timed out.So the structure is deleted
    from BSEG table but those 5 fields are still present in view V_QCMBSEG .Because of this BSEG table
    is now partially active .what should i do other than access key .

    Dear Deepak,
    welcome to SCN.
    How did you append structure in BSEG without access key, if you had appended you must have done it will access key as it is a standard table.
    secondly, the time out error is because BSEG is a cluster table, and the data volume in Bseg is very large as all the accounting document from various module is stored in this table, hence while deleting it system will check each line item wise before activating the table.
    Now the workaround is to check with your basis team to increase the memory index so that time out dump is eradicted and BSG becomes Active.
    Best practice: Don't append structure to standard table unless it is very crucial. if you are doing it for some report, kindly do a table join ( BSEG cannot be used as it is a cluster), you will get the same data in various secondary index table, by doing this the performance of the report will be better.
    Regards,
    M S Lokesh

  • Data fetching from BSEG table

    Hi,
    I have used smartforms for generating suppler payment statement for financial department. more time duration is taken by the program when it is generating.
    I think this problem comes while data fetching from BSEG table. because, it has more records for one vendor ID.
    I want reduce this time duration.
    Please guide me.

    Have you tried this selection in se16? I'm quite sure that It will take
    a long time.
    The problem has been explained in this group before and I think you
    should search for bseg in the answers given.
    As a hint: It has to do with the selection universe. You are restricting
    only bukrs from the primary key (all the other restrictions in your
    where clause are filters that are applied on SAP's side (not on the
    database side)). The problem is that bseg isn't stored as separated
    fields in the RDBMS, but as a table with the primary key and a stream of
    bits in a raw field.
    You should review and change the logic you're using before reading bseg.
    It's the only way you'll improve the performance of this select. (for
    example, you could use one or more secondary index tables - bi or ba
    to retrieve belnr and access bseg with a better where clause).

  • Function module for BSEG table

    Hi Guru's,
      SELECT bukrs
             belnr
             gjahr
             budat
             monat
             waers
             awkey
        FROM bkpf
        INTO TABLE i_bkpf_data
        WHERE  bukrs EQ pa_bukrs AND
               budat IN so_budat.
    SORT i_bkpf_data BY bukrs belnr gjahr.
        IF i_bkpf_data[] IS NOT INITIAL.
          SELECT bukrs belnr gjahr koart dmbtr wrbtr pswsl
                 kokrs kostl hkont aufnr lifnr ebeln buzei shkzg
            FROM bseg
            INTO TABLE i_bseg_data
            FOR ALL ENTRIES IN i_bkpf_data
            WHERE 
                    bukrs  EQ pa_bukrs AND
                   belnr    EQ i_bkpf_data-belnr AND
                   gjahr    EQ i_bkpf_data-gjahr AND
                   kostl    IN so_kostl AND
                   lifnr      IN so_lifnr AND
                   hkont   IN so_hkont.
       ENDIF.
    I got performance issue on this Query..while accessing the data from BSEG table,its makes performance issue in my program so i want to improve performance of the program.i was analysed that BSEG table makes performance issue..
    Hi..Anybody give the solution imporving this Query or give some function module for accessing BSEG table..
    Note..I want to pass my selection inputs also into function module..i was seen some function module for BSEG,those are not satisfying the my inputs so those also making performance issue..
    Regards
    P.Senthil Kumar

    Hi Everybody,
    About how to use this function Does anyone have an idea?
    I've found it.
    call function 'FI_DOCUMENT_READ'
    exporting
       i_awtyp = 'VBRK'
       i_awref = vbfa_tab-vbeln
       i_awsys = vbrk-logsys
       i_bukrs = vbrk-bukrs
       i_gjahr = vbrk-gjahr
    tables
       t_bkpf = xbkpf
       t_bseg = xbseg
    exceptions
    wrong_input = 1
    not_found = 2.
    But this is not enough.
    Best Regards Rasim.

  • INDEX UNIQUE SCAN instead of   INDEX FULL SCAN or TABLE ACCESS FULL

    I have calculated statistics in all tables and indexes
    I have a table and a view and when I put it
    SELECT *
    FROM TABLE_A A
    INNER JOIN VIEW_B B ON A.KEY_ID = B.PFK_KEY_ID          
    WHERE (B.FK_ID_XXX = 1)
    If I see the execution plan:
    In TABLE_A make a
    TABLE ACCESS BY INDEX ROWID
    INDEX UNIQUE SCAN (FIELD_A_TABLE_A_PK)
    It’s OK. I NEED IT (INDEX UNIQUE SCAN)
    But If I put
    SELECT A.Field_1, A.Field_2, A.Field_3, A.Field_4
    FROM TABLE_A A
    INNER JOIN VIEW_B B ON A.KEY_ID = B.PFK_KEY_ID          
    WHERE (B.FK_ID_XXX = 1)
    In table A make a TABLE ACCESS FULL.
    Then If I put:
    SELECT /*+ INDEX(A FIELD_A_TABLE_A_PK) */ A.Field_1, A.Field_2, A.Field_3, A.Field_4
    FROM TABLE_A A
    INNER JOIN VIEW_B B ON A.KEY_ID = B.PFK_KEY_ID          
    WHERE (B.FK_ID_XXX = 1)
    If I see the execution plan:
    In TABLE_A make a
    TABLE ACCESS BY INDEX ROWID
    INDEX UNIQUE SCAN (FIELD_A_TABLE_A_PK)
    It’s OK. I NEED IT (INDEX UNIQUE SCAN)
    Finally, If I put other tables and views in the query (I NEED IT)
    For example:
    SELECT /*+ INDEX(A FIELD_A_TABLE_A_PK) */ A.Field_1, A.Field_2, A.Field_3, A.Field_4
    FROM TABLE_A A
    INNER JOIN VIEW_B B ON A.KEY_ID = B.PFK_KEY_ID          
    INNER JOIN TABLE_C….
    LEFT JOIN VIEW_D….
    WHERE (B.FK_ID_XXX = 1)
    If I see the execution plan:
    In TABLE_A make a
    TABLE ACCESS BY INDEX ROWID
    INDEX FULL SCAN (FIELD_A_TABLE_A_PK)
    I need INDEX UNIQUE SCAN instead of INDEX FULL SCAN or TABLE ACCESS FULL.
    How can obtain it?
    What happens???
    Thanks!

    Notice the difference in cardinality between your two select statements:
    SELECT STATEMENT, GOAL = ALL_ROWS Cost=5 Cardinality=1
    SELECT STATEMENT, GOAL = ALL_ROWS Cost=10450 Cardinality=472161Apparently since the optimizer believed the first statement was going to return one row, it used an index. But in the second statement it believed it was going to return nearly the whole table (didn't you say it had around 500k rows?). Hence full table scan.

  • F110 - Grouping the vendor invoices by BSEG table fields

    Hi,
    I want to group the vendor invoices while making the payment through F110,  based on a BSEG table field. The settings in Grouping Key configuration (OBAP) only allows me to choose the fileds from BSIK table and not possible to select the fields from BSEG table.  Is there any other way to group the vendor invoices based on BSEG fileds?  How can we achieve this requirement in SAP?
    Thanks and Regards
    Koteswararao padarti

    Hi,
    I created the substitution and also grouping key based on the BSIK-KIDNO filed. But the system is not able to group the vendor invoices by payment reference.  I already tried the following options
    Seperate Payments for each Ref in FBZP settings
    Can anyone let me know what is missing in the configuration to group the invoices for payment by payment reference.
    Regards
    Koteswararao Padarti

  • XREF3 field not getting populated in BSEG table while posting MIRO

    Hi,
         I have one query in MIRO tcode.I have activated xref3 field in MIRO tcode using enhancement LMR1MF6Q.Now when i try to post document with some values in xref3 field on screen ,value is not getting populated in BSEG table.Please tell me what else needs to be done to achieve this ?
    any hint on this?
    Thanks & Regards,
    Soniya S.

    Hi,
    1.- According to SAP Note 904652 - MIRO: Different from FB60
    https://service.sap.com/sap/support/notes/904652
    MIRO is an independent Materials Management (MM) transaction that does not
    claim to be the same as the accounting transactions (such as FB60 or FB01).
    MIRO was developed to allow users to process vendor invoices within the
    context of the MM procurement processes as simply as possible.
    For this reason, among other differences, the field selection was limited
    to the absolutely necessary. For example, the following fields from the
    accounting document are not available in Transaction MIRO (this list is not
    complete):
    Reference key (BSEG-XREF1, -XREF 2, -XREF 3)
    2.- SAP Note 1156325 - BAdIs in the Logistics Invoice Verification environment
    https://service.sap.com/sap/support/notes/1156325
    Have a look at badi MRM_ITEM_CUSTFIELDS.
    This badi will create a new tab at item level in order to display the new fields.
    I haven´t used this badi so i cannot talk from experience here.
    Think twice before deciding.
    Best regards.

  • Error while appending structure into BSEG Table

    We had appended BSEG table with a ZSTRUCTURE to enable Custom field in MIRO. Subsequently there was a change required in the appended field. After Changing the field there was adjustment required to activate the appended table . However due to slow system performance during that time the Adjustment SE14 timed out. And created inconsistency in BSEG table.
    If I Do the Table adjustment now it is showing below error.
    We tried to delete the append structure also but the structure is not appearing in the append structure list to delete.
    Even if we try deleting the Z structure from se11 it is throwing below error.
    Any one could help me out to resolve this..

    hi Ramesh,
    Please First Check if the Database version and disctionary version are in sync.
    Also, it could be the case that you would have enhanced an already existing Append stucture. which might be being used in other BKPF dependent tables.
    Please check

  • PO Line Item Number not filled in BSEG Table

    HI,
    While posting to goods receipt through MIGO FI documents are generated.
    For these  FI documents ,  in BSEG table the corresponding  PO line item numbers (EBELP )are not getting filled up,
    How can they be filled. can it be done through any standard configuration?

    Hi,
    Check if you are doing the summarization of FI doc. You can check reading these notes:
    SAP Note 36353 - AC interface: Summarizing FI documents
    SAP Note 77161 - Summarization of FI postings w.ref.to purchase orders
    I hope this helps you
    Regards
    Eduardo

  • FBL5N t code and BSEG table is showing wrong contract number

    Hi,
    The proces flow is contract number>sales order>DMR-->Invoice
    Now when I am checking the VBFA table it's showing correct contract number against invoices but FBL5N t code and BSEG table are showing wrong contract numbers.
    Why FBL5N and BSEG table is showing wrong contract number?
    Currently we are using one enhancement and user exit is used to incorporate one customized field as identifier for bill type.
    1. During the billing document release to accounting VFX3, The user exit triggering and it is update the customized fields and Net settlement indicator.
    2. Using the Invoice number, get the fields VGBEL(Document number of the reference document) and VGPOS (Item number of the reference item) from VBRP and read table VBAP with VBELN and POSNR, to get DMR number (Sales Document) that created for the Invoice.
    3. Use fields VGBEL and VGPOS on table VBAP to get the sale order number.
    4. By using the Sales order number, get the Distribution channel to update Net indicator field
    In accounting table BSEG-UZAWE = JF must be updated on the customer line.
    5. Retrieve the sale order number and item level to get customized field from table VBAP
    Any pointers.
    Thanks
    Ashu

    Hi Reazuddin,
    Thanks for your reply,
    I am concercerned about BSEG table and using user exit EXIT_SAPLV60B_008 to post the document in FI.
    Now in we have enhanced this user exit  for contracts and included in this way.
      SELECT SINGLE ZZ_CONTRACT FROM VBAK INTO (LC_CONTRACT) WHERE VBELN EQ cvbrp-vgbel.
    Endloop.
    *Moving the values to final accounting table
    loop at xaccit.
    xaccit-vertn = lc_contract.
    xaccit-VBEL2 = xaccit-AUBEL.
    xaccit-xref3 = lc_vbel2.
    MODIFY xaccit .
    ENDLOOP.
    Clear: lc_contract,lc_vgbel,lc_vgpos,lc_vbel2.
    But I am getting correct data when checked other clients( development and quality), this problem I am getting in production.
    Do I need to ask the ABAP'er to debug this enhancement in production?
    Thanks
    Ashutosh

  • Update BSEG table for PERNR

    Hi,
    How to update PERNR Field BSEG Table?
    My scenario is to update the (Personnel Number ) PERNR Field in FB50 Transaction.
    I get the following fields details from a third party system
    Document Information 
    o     I_BUKRS (Company Code) u2013 example: 0010
    o     I_BELNR (Document Number) u2013 example: 1700006041
    o     I_GJAHR (Fiscal Year) u2013 example: 2008
    u2022     Final Approver ID
    o     I_PERNR (Personnel No.) u2013 example U0050049
    For all line items of the document (represented by the key  (I_BUKRS, I_BELNR, I_GJAHR)) need to update the BSEG-PERNR field in FB50.
    Please let me know if you have any ideas like BAPI's or any alternative.
    Thanks & Regards,
    Satya

    Hi
    Try to use below the FM's
    FMUDBSEGH_UPDATE
    FMUDBSEG_UPDATE
    G_BKPF_BSEG_UPDATE
    before to that you need to read data from FM READ_BSEG. then update.
    hope it helps you
    Thanks!
    Edited by: Prasanth Maddela on Apr 21, 2009 6:26 PM

  • Bseg Table Issue

    Hi,
    Below is my code, it taking much time to get the data from BSEG table and even after executing for long time it not populating the data into internal table. If i pass single account in selection screen, it is displaying the data.
    Please help me out.
      SELECT hkont lkorr FROM t030hb INTO CORRESPONDING FIELDS OF
                          TABLE gt_tr_t030hb
                          WHERE ktopl = 'ZCOA'
                          AND   bwber = 'TR'
                          and hkont in so_hkont.
      IF gp_pprct IS INITIAL.
      loop at gt_tr_t030hb.
        SELECT hkont prctr bewar dmbe2 FROM bseg INTO CORRESPONDING
                           FIELDS OF table gt_hkont for all entries
                           in gt_tr_t030hb
                           WHERE bukrs IN so_bukrs
                           AND prctr IN so_prctr
                           AND saknr = gt_tr_t030hb-hkont
                           AND vbund IN so_vbund
                           and gjahr in so_gjahr
                           and xauto = 'X'.
    Thanks,
    Pavan.
    Message was edited by: Pavan Panduru

    Hi
    Try to select the items from BSIS/BSAS:
    - One solution can be:
    TABLES: BSIS.
    DATA:  GT_TR_T030HB LIKE STANDARD TABLE OF  T030HB.
    SELECT-OPTIONS: SO_BUKRS FOR BSIS-BUKRS,
                    SO_HKONT FOR BSIS-HKONT,
                    SO_GJAHR FOR BSIS-GJAHR,
                    SO_PRCTR FOR BSIS-PRCTR,
                    SO_VBUND FOR BSIS-VBUND.
    DATA: BEGIN OF GT_HKONT OCCURS 0,
            BUKRS LIKE BSIS-BUKRS,
            HKONT LIKE BSIS-HKONT,
            GJAHR LIKE BSIS-GJAHR,
            BELNR LIKE BSIS-BELNR,
            BUZEI LIKE BSIS-BUZEI,
            PRCTR LIKE BSIS-PRCTR,
            BEWAR LIKE BSIS-BEWAR,
            DMBE2 LIKE BSIS-DMBE2,
          END OF GT_HKONT.
    DATA: XAUTO.
    SELECT * FROM T030HB INTO TABLE GT_TR_T030HB
                        WHERE HKONT IN SO_HKONT
    Open Items (BSIS)
    SELECT BUKRS HKONT GJAHR BELNR BUZEI
           PRCTR BEWAR DMBE2
           FROM BSIS INTO TABLE GT_HKONT
            FOR ALL ENTRIES IN GT_TR_T030HB
                          WHERE BUKRS IN SO_BUKRS
                            AND HKONT = GT_TR_T030HB-HKONT
                            AND GJAHR IN SO_GJAHR
                            AND PRCTR IN SO_PRCTR
                            AND VBUND IN SO_VBUND.
    Cleared items
    SELECT BUKRS HKONT GJAHR BELNR BUZEI
           PRCTR BEWAR DMBE2
           FROM BSAS APPENDING TABLE GT_HKONT
            FOR ALL ENTRIES IN GT_TR_T030HB
                          WHERE BUKRS IN SO_BUKRS
                            AND HKONT = GT_TR_T030HB-HKONT
                            AND GJAHR IN SO_GJAHR
                            AND PRCTR IN SO_PRCTR
                            AND VBUND IN SO_VBUND.
    If you need to check if the item is automatically loaded:
    LOOP AT GT_HKONT.
      SELECT SINGLE XAUTO FROM BSEG INTO XAUTO
                                    WHERE BUKRS = GT_HKONT-BUKRS
                                      AND BELNR = GT_HKONT-BELNR
                                      AND GJAHR = GT_HKONT-GJAHR
                                      AND BUZEI = GT_HKONT-BUZEI.
      IF XAUTO = SPACE.
        DELETE GT_HKONT.
      ENDIF.
    ENDLOOP.
    Other solution can be
    TABLES: BSIS.
    DATA:  GT_TR_T030HB LIKE STANDARD TABLE OF  T030HB.
    SELECT-OPTIONS: SO_BUKRS FOR BSIS-BUKRS,
                    SO_HKONT FOR BSIS-HKONT,
                    SO_GJAHR FOR BSIS-GJAHR,
                    SO_PRCTR FOR BSIS-PRCTR,
                    SO_VBUND FOR BSIS-VBUND.
    DATA: BEGIN OF T_DOCUMENT OCCURS 0,
            BUKRS LIKE BSIS-BUKRS,
            GJAHR LIKE BSIS-GJAHR,
            BELNR LIKE BSIS-BELNR,
            BUZEI LIKE BSIS-BUZEI,
          END   OF T_DOCUMENT.
    DATA: BEGIN OF GT_HKONT OCCURS 0,
            HKONT LIKE BSIS-HKONT,
            PRCTR LIKE BSIS-PRCTR,
            BEWAR LIKE BSIS-BEWAR,
            DMBE2 LIKE BSIS-DMBE2,
          END OF GT_HKONT.
    DATA: XAUTO.
    Open Items (BSIS)
    SELECT BUKRS GJAHR BELNR BUZEI
           FROM BSIS INTO TABLE T_DOCUMENT
            FOR ALL ENTRIES IN GT_TR_T030HB
                          WHERE BUKRS IN SO_BUKRS
                            AND HKONT = GT_TR_T030HB-HKONT
                            AND GJAHR IN SO_GJAHR
                            AND PRCTR IN SO_PRCTR
                            AND VBUND IN SO_VBUND.
    Cleared items
    SELECT BUKRS GJAHR BELNR BUZEI
           FROM BSAS INTO TABLE T_DOCUMENT
            FOR ALL ENTRIES IN GT_TR_T030HB
                          WHERE BUKRS IN SO_BUKRS
                            AND HKONT = GT_TR_T030HB-HKONT
                            AND GJAHR IN SO_GJAHR
                            AND PRCTR IN SO_PRCTR
                            AND VBUND IN SO_VBUND.
    Auto items
    SELECT HKONT PRCTR BEWAR DMBE2
           FROM BSEG INTO TABLE GT_HKONT
            FOR ALL ENTRIES IN T_DOCUMENT
                          WHERE BUKRS = T_DOCUMENT-BUKRS
                            AND BELNR = T_DOCUMENT-BELNR
                            AND GJAHR = T_DOCUMENT-GJAHR
                            AND BUZEI = T_DOCUMENT-BUZEI
                            AND XAUTO = 'X'.
    Try
    Max

  • Down load from BSEG Table

    Hi
    Friends
    we have around 50 millions records in the Bseg table.
    i need to down load only 5 fields .
    one our friend suggested using ABAP code we can down load.
    But i would like to know from you is there any Transcation code to down load only 4 or 5 fields from bseg fro all the company codes since we have around 50 million Records inthe table.
    Thanks in advance.

    Hi Ravindra,
    Good afternoon and greetings,
    In SE16 itself you can down only the selected field by choosing the User Parameters...Alternatively, you can create a query using SQVI and select only those fields for displaying and downloading.
    If you require any assistance on SQVI, please let me know.
    Points awarded is highly appreciated, if the above mentioned solution meets your requirement.
    Thanking you
    With kindest regards
    Ramesh Padmanabhan
    Consultant

  • ST05 Trace on a select query on BSEG table

    hi all,
    this is my select query on table BSEG table:
      SELECT bukrs
             belnr
             gjahr
             buzei
             KOART
             mwskz
             kostl
             lifnr
             aufnr
             werks
             ebeln
             txjcd
             projk FROM bseg
                   INTO TABLE i_bseg
                   FOR ALL ENTRIES IN i_ad_tab
                  WHERE bukrs EQ i_ad_tab-bukrs  AND
                        belnr EQ i_ad_tab-belnr  AND
                        gjahr EQ i_ad_tab-gjahr.
    when i m doing SQL trace ST05 on this query and in the detail statement showed the following query
    SELECT
      "MANDT" , "BUKRS" , "BELNR" , "GJAHR" , "PAGENO" , "TIMESTMP" ,
      "PAGELG" , "VARDATA"
    FROM
      "RFBLG"
    WHERE
      "MANDT" = ? AND  "BUKRS" = ? AND  "BELNR" = ? AND  "GJAHR" = ?
    ORDER BY
      "MANDT" , "BUKRS" , "BELNR" , "GJAHR" , "PAGENO"
    what is RFBLG table in SE11, but could not find it.
    what is RFBLG?also, the above select query giving me performance issues.. the "for all entries" clause is used as per norms...
    please suggest a solution..

    hi
    good
    The famous BSEG table is a cluster table.
    It is as was correctly stated part of the Accounting Document Segment. It is part of the Pool cluster RFBLG and lives in the package: FBAS (Financial accounting 'Basis').
    You can't read a cluster table exactly the way you read a database (old speak, transparent table).
    You can use a program to read called RFPPWF05
    Note 435694: Display BSEG item by calling FB09D (modified FB09)
    Other possiblity: Other possibility: CALL DIALOG 'RF_ZEILEN_ANZEIGE', but since this is a dialog I don't think this would work.
    In any event go to FBAS Package (development class) to see your business objects, class library and functions.
    you must use keyfields bukrs , belnr, gjahr
    (so 1st select table bkpf) to select bseg.
    or use secondary index tables:
    bsas, bsis, bsik, bsak, bsid, bsad
    Regards,
    Raj.

  • Using index in a query return few records than full table access

    Today we have an issue with a query, when it use the ok index the returned are not all records that apply to where clause condition.
    See bellow
    explain plan for
    select * from movdb.zan_m03 where
    M00AF = TO_DATE('11/01/28','YY/MM/DD') AND
    M00za = 10 AND
    m00AC = 50 AND
    M00AD between 136906 and 136999
    SELECT * FROM TABLE(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 1882720105
    | Id | Operation | Name |
    | 0 | SELECT STATEMENT | |
    | 1 | TABLE ACCESS BY INDEX ROWID| ZAN_M03 |
    |* 2 | INDEX RANGE SCAN | PK_ZAN_M03 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
    2 - access("M00AF"=TO_DATE('11/01/28','YY/MM/DD') AND "M00ZA"=10 AND
    "M00AC"=50 AND "M00AD">=136906 AND "M00AD"<=137141)
    filter("M00AD"<=137141 AND "M00AD">=136906)
    Note
    - rule based optimizer used (consider using cbo)
    20 rows selected.
    The query above return only one row insted 1579 record that apply to this conditions.
    When forcing a full table acess with a hint, the query return all records that apply, the 1579 record.
    select /*+ FULL(zan_m03) */ M00AF, M00za, m00AC , M00AD from movdb.zan_m03 where
    M00AF = TO_DATE('11/01/28','YY/MM/DD') AND
    M00za = 10 AND
    m00AC = 50 AND
    M00AD between 136906 and 137141
    Can you help me to identify what's happening?
    I am with Oracle 10g R2 10.2.0.4 standard edition
    the statistics are up to date
    the opitimizer_mode are rule, but altering in session level to all_rows happens the same issue.
    Nothing about corruption in the alert log.
    Thanks in advance
    Regards
    Cristiano

    Yes the query are the same and correct restriction for where clause are M00AD between 136906 and 137141.
    I've pasted, by mistake, another test query
    The corrects are:
    select M00AF, M00za, m00AC , M00AD from movdb.zan_m03 where
    M00AF = TO_DATE('11/01/28','YY/MM/DD') AND
    M00za = 10 AND
    m00AC = 50 AND
    M00AD between 136906 and 137141
    This use pk index and return one row
    select /*+ FULL(zan_m03) */ M00AF, M00za, m00AC , M00AD from movdb.zan_m03 where
    M00AF = TO_DATE('11/01/28','YY/MM/DD') AND
    M00za = 10 AND
    m00AC = 50 AND
    M00AD between 136906 and 137141
    This does a full table access and return 1579 records
    I´ve been searching for wrong results bugs on my oracle support, but not found one that mentions something like our issue.
    I checked the dba_tables and dba indexes and the number of rows are different, and I think this would be the same because it's is a pk.
    Look this
    SQL> select NUM_ROWS from dba_tables where table_name = 'ZAN_M03'
    2 /
    NUM_ROWS
    228527878
    select NUM_ROWS from dba_indexes where index_name = 'PK_ZAN_M03';
    SQL> select NUM_ROWS from dba_indexes where index_name = 'PK_ZAN_M03';
    NUM_ROWS
    217510185
    Is normal a index for pk having much fewer rows than table? I think not, but not sure.
    Again
    Thanks in advance
    Regards
    Cristiano

Maybe you are looking for