Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Problem with XMLType indexing XPATH?

Problem with XMLType indexing XPATH?

From: Ko van der Sloot <Ko.vanderSloot_at_uvt.nl>
Date: Wed, 20 Apr 2005 18:20:45 +0200
Message-ID: <d45vgu$97j$1@troll.uvt.nl>


Hello,
i'm a rookie with Oracle, Oracle text en Oracle XMLtype, so my problem might wel be some misunderstanding, but anyway:

Below you will find an script bug.sql which behaves very strange on my system:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.4.0 - Production

I thought that i could speep up searches with existsNode() after the command:
create index my_x_idx on bug(data_char) indextype is ctxsys.CTXXPATH;

as described in my Oracle 9i manual chapter 4, page 4-42

But after this, i get wrong results:
It seems that OR is not symetric anymore !?

Is it my bug, probably, or an Oracle problem?

clueless,
Ko vd Sloot

the script:



drop table bug;

create table bug ( doc_id NUMBER, data_char xmltype ); insert into bug values( 1, XMLType(
'<document>

<ti>Test 1</ti>
<au>Jan</au>
<py>2002</py>

  </document>' ) );

insert into bug values( 2, XMLType(
'<document>

<ti>Test 2</ti>
<au>Pier</au>
<py>2003</py>

  </document>' ) );

insert into bug values( 3, XMLType(
'<document>

<ti>Test 3</ti>
<au>Joris</au>
<py>2003</py>

  </document>' ) );

insert into bug values( 4, XMLType(
'<document>

<ti>Test 2 ander jaar</ti>
<au>Corneel</au>
<py>2002</py>

  </document>' ) );

insert into bug values( 5, XMLType(
'<document>

<ti>Test 5</ti>
<au>Bontekoe</au>
<py>2003</py>

  </document>' ) );

create index my_idx on bug(data_char) indextype is ctxsys.context;

select count( doc_id ) from bug where
existsNode(data_char,'//py[.>"2002"]') > 0 OR contains(data_char,'2 inpath(//ti)' ) > 0;
select count( doc_id ) from bug where contains(data_char,'2 inpath(//ti)' ) > 0 OR existsNode(data_char,'//py[.>"2002"]') > 0;

create index my_x_idx on bug(data_char) indextype is ctxsys.CTXXPATH;

select count( doc_id ) from bug where
existsNode(data_char,'//py[.>"2002"]') > 0 OR contains(data_char,'2 inpath(//ti)' ) > 0;
select count( doc_id ) from bug where contains(data_char,'2 inpath(//ti)' ) > 0 OR existsNode(data_char,'//py[.>"2002"]') > 0; Received on Wed Apr 20 2005 - 11:20:45 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US