1 Reply Latest reply on May 1, 2007 3:11 PM by Mannamal-Oracle

    query performance

    447384
      I have a query that looks like the following:
      SELECT strreplace(x, 'ldif:', '') "DN"
      FROM TABLE(SDO_RDF_MATCH(
      ' (?x :DN ?n) ',
      SDO_RDF_Models('cs347_49_model'),
      SDO_RDF_Rulebases ('RDFS', 'cs347_49_RB'),
      SDO_RDF_Aliases (SDO_RDF_Alias('', 'ldif:')),
      null))

      I also have a rule that looks like the following:
      INSERT INTO mdsys.rdfr_cs347_49_rb VALUES(
      'DN_rule',
      '(?x :DN ?y)',
      NULL,
      '(?x :DN ?y)',
      SDO_RDF_Aliases(SDO_RDF_Alias('','ldif:')));

      The query performs very slowly. I thought that by having the rule an index would be built and used by the query. Is that not the case?
      thanks
      phil
        • 1. Re: query performance
          Mannamal-Oracle
          Hi,

          The rules index applies the rule to the data in the RDF Model (so the 'rules index' is not related to peformance). But internally several indexes are built by the system and used for the RDF query (the user does not need to create them, these are automatically built).

          Your query looks simple, and the performance should be very good. One question about the rules - the antecedent and the consequent seem to be the same. This means every triple is generating a new triple during entailment (rules index creation). Is that a typo in the post, or is that your intention?

          Some suggestions for improved performance:
          (1) Running statistics will help query performance:

          begin
          dbms_stats.gather_table_stats(ownname => 'MDSYS',
          tabname => 'RDF_VALUE$',
          cascade => TRUE,
          no_invalidate => FALSE
          );
          dbms_stats.gather_table_stats(ownname => 'MDSYS',
          tabname => 'RDF_LINK$',
          cascade => TRUE,
          no_invalidate => FALSE
          );
          dbms_stats.gather_table_stats(ownname => 'MDSYS',
          tabname => 'RDF_BLANK_NODE$',
          cascade => TRUE,
          no_invalidate => FALSE
          );
          end;
          /

          (2) Upgrade to the latest patch: If you are on 10.2.0.1, then there is an RDF specific patch (Patch: 5557859 - RDF RELEASE BUNDLE BLR FOR 10.2.0.1 (metalink number 8940445)) that fixes a performance bug in case you are running into that. If you are on Oracle 10.2.0.3, then the RDF specific patch (Patch: 5754970 - RDF RELEASE BUNDLE BLR FOR 10.2.0.3) should be applied.

          If these don't help, you could write to me your PGA and SGA settings at melliyal <dot> annamalai <at> oracle <dot> com so that we can explore whether tuning issues are affecting performance.

          Melli