You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Wojtek <vi...@gazeta.pl> on 2004/03/29 13:15:30 UTC

Xindice is very slow

Hello,
I am a begginer with xml databases and I have some questions for you. I have
to work with xindice and acces it from Java level. My first impression is
that xindice is very slow. Processing any query (xpath) last several
seconds! Is that correct or just I am doing something wrong?
Configuration:
Linux PLD kernel 2.4.20
Java 1.4.2_01
xindice - 1.0 standalone

Greetings,
Wojtek



Re: Index pattern

Posted by Vadim Gritsenko <va...@reverycodes.com>.
See also:
  
http://cvs.apache.org/viewcvs.cgi/xml-xindice/java/src/org/apache/xindice/core/indexer/Indexer.java?annotate=1.6

Javadoc for method getPattern(), lines 63-76. It lists supported pattern 
types. Also note, that there are two types of indexes - Name and Value. 
First one is good for tests on presense of element / attribute, second 
one - for tests on values of the element / attribute.

Vadim


Vadim Gritsenko wrote:

> Wojtek wrote:
>
>> ----- Original Message ----- From: "Vadim Gritsenko" 
>> <va...@reverycodes.com>
>>  
>>
>>> No; more like ... -p user@login , so you will be able to find any user
>>> by his login quickly.
>>>   
>>
>>
>> Sorry, I'd made a mistake. I thought about pattern:   ...-p 
>> user@login/url
>> maybe ...-p user[@login]/url    is correct? I am afraid I expect too 
>> much :)
>>  
>>
>
> You don't need "url" part - except the case when you have lots of 
> users with same username but only some of them have "url'. In this 
> artificial example, you would create two indexes: first index on 
> "user@login", so you can find users by login quickly, and second on 
> "url" element, to filter out users who do not have url element. Hope 
> you got the point - you can have an index for each predicate you want 
> to speed up.
>
> Vadim



Re: Index pattern

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Wojtek wrote:

>----- Original Message ----- 
>From: "Vadim Gritsenko" <va...@reverycodes.com>
>To: <xi...@xml.apache.org>
>Sent: Wednesday, March 31, 2004 11:02 PM
>Subject: Re: Index pattern
>
>
>  
>
>>You don't need "url" part - except the case when you have lots of users 
>>with same username but only some of them have "url'. In this artificial 
>>example, you would create two indexes: first index on "user@login", so 
>>you can find users by login quickly, and second on "url" element, to 
>>filter out users who do not have url element. Hope you got the point - 
>>you can have an index for each predicate you want to speed up.
>>
>>    
>>
>So I should use two indexes: 
>-p user@login
>-p url
>I hope I got the point. Thanks for help.
>  
>

If you have url element always (for all users) - you don't need this 
second index.
If you have only one user per login (and for query example you gave 
before) - you also do not need this second index.
In some other circumstances, you might need multiple indexes.

Vadim


Re: Index pattern

Posted by Wojtek <vi...@gazeta.pl>.
----- Original Message ----- 
From: "Vadim Gritsenko" <va...@reverycodes.com>
To: <xi...@xml.apache.org>
Sent: Wednesday, March 31, 2004 11:02 PM
Subject: Re: Index pattern


> You don't need "url" part - except the case when you have lots of users 
> with same username but only some of them have "url'. In this artificial 
> example, you would create two indexes: first index on "user@login", so 
> you can find users by login quickly, and second on "url" element, to 
> filter out users who do not have url element. Hope you got the point - 
> you can have an index for each predicate you want to speed up.
> 
So I should use two indexes: 
-p user@login
-p url
I hope I got the point. Thanks for help.

Greetings,
Wojtek



Re: Index pattern

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Wojtek wrote:

>----- Original Message ----- 
>From: "Vadim Gritsenko" <va...@reverycodes.com>
>  
>
>>No; more like ... -p user@login , so you will be able to find any user
>>by his login quickly.
>>    
>>
>
>Sorry, I'd made a mistake. I thought about pattern:   ...-p user@login/url
>maybe ...-p user[@login]/url    is correct? I am afraid I expect too much :)
>  
>

You don't need "url" part - except the case when you have lots of users 
with same username but only some of them have "url'. In this artificial 
example, you would create two indexes: first index on "user@login", so 
you can find users by login quickly, and second on "url" element, to 
filter out users who do not have url element. Hope you got the point - 
you can have an index for each predicate you want to speed up.

Vadim


Re: Index pattern

Posted by Andy Armstrong <an...@tagish.com>.
Wojtek wrote:
> Sorry, I'd made a mistake. I thought about pattern:   ...-p user@login/url
> maybe ...-p user[@login]/url    is correct? I am afraid I expect too much :)

Why do you need the /url bit?

-- 
Andy Armstrong, Tagish


Re: Index pattern

Posted by Wojtek <vi...@gazeta.pl>.
----- Original Message ----- 
From: "Vadim Gritsenko" <va...@reverycodes.com>
To: <xi...@xml.apache.org>
Sent: Wednesday, March 31, 2004 12:04 AM
Subject: Re: Index pattern


> Wojtek wrote:
>
> >Hello,
> >I'd like to improve my database and use some indexes, but I have doubts.
> >File in collection looks like this:
> ><user login=wojtek>
> >        <url>my_url</url>
> >        ...
> ></user>
> >
> >I want to make xpath query:
> >/user[@login='wojtek']/url
> >
> >My question is how to write index pattern to make processing of above
query
> >most efficient?
> >Is this correct:  ...-p user@login/wojtek  ?
> >
> >
>
> No; more like ... -p user@login , so you will be able to find any user
> by his login quickly.
>

Sorry, I'd made a mistake. I thought about pattern:   ...-p user@login/url
maybe ...-p user[@login]/url    is correct? I am afraid I expect too much :)

Greetings,
Wojtek



Re: Index pattern

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Wojtek wrote:

>Hello,
>I'd like to improve my database and use some indexes, but I have doubts.
>File in collection looks like this:
><user login=wojtek>
>        <url>my_url</url>
>        ...
></user>
>
>I want to make xpath query:
>/user[@login='wojtek']/url
>
>My question is how to write index pattern to make processing of above query
>most efficient?
>Is this correct:  ...-p user@login/wojtek  ?
>  
>

No; more like ... -p user@login , so you will be able to find any user 
by his login quickly.

Vadim



Index pattern

Posted by Wojtek <vi...@gazeta.pl>.
Hello,
I'd like to improve my database and use some indexes, but I have doubts.
File in collection looks like this:
<user login=wojtek>
        <url>my_url</url>
        ...
</user>

I want to make xpath query:
/user[@login='wojtek']/url

My question is how to write index pattern to make processing of above query
most efficient?
Is this correct:  ...-p user@login/wojtek  ?

Greetings,
Wojtek



Re: Xindice is very slow

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Andy Armstrong wrote:

> Wojtek wrote:
>
>> Ok, I am not working with it until tomorrow, then I'll try it. But 
>> have you
>> ever met that kind of problem as mine?
>
>
> Well I expect we've all experienced queries that take longer than 
> expected to execute... I would recommend switching to 1.1b3 and making 
> sure you're creating indexes that will support the query you're having 
> problems with.


... and you are using query which is indexable in a first place, and you 
are not pouring proverbial 5mb xml files into the collections.

Vadim


Re: Xindice is very slow

Posted by Andy Armstrong <an...@tagish.com>.
Wojtek wrote:

> Ok, I am not working with it until tomorrow, then I'll try it. But have you
> ever met that kind of problem as mine?

Well I expect we've all experienced queries that take longer than 
expected to execute... I would recommend switching to 1.1b3 and making 
sure you're creating indexes that will support the query you're having 
problems with.

-- 
Andy Armstrong, Tagish


Re: Xindice is very slow

Posted by Wojtek <vi...@gazeta.pl>.
Ok, I am not working with it until tomorrow, then I'll try it. But have you
ever met that kind of problem as mine?

Greetings,
Wojtek



Re: Xindice is very slow

Posted by Andy Armstrong <an...@tagish.com>.
Wojtek wrote:
> Thanks! But why? Is there any big difference in efficiency between them?

They're barely the same thing at all. There are far greater changes than 
the small version jump indicates.

-- 
Andy Armstrong, Tagish


Re: Xindice is very slow

Posted by Wojtek <vi...@gazeta.pl>.
----- Original Message ----- 
From: "Andy Armstrong" <an...@tagish.com>
To: <xi...@xml.apache.org>
Sent: Monday, March 29, 2004 1:24 PM
Subject: Re: Xindice is very slow


> Wojtek wrote:
>
> > Hello,
> > I am a begginer with xml databases and I have some questions for you. I
have
> > to work with xindice and acces it from Java level. My first impression
is
> > that xindice is very slow. Processing any query (xpath) last several
> > seconds! Is that correct or just I am doing something wrong?
> > Configuration:
> > Linux PLD kernel 2.4.20
> > Java 1.4.2_01
> > xindice - 1.0 standalone
>
> The first thing to do is to switch to 1.1b3.
>
Thanks! But why? Is there any big difference in efficiency between them?

Greetings,
Wojtek



Re: Xindice is very slow

Posted by Andy Armstrong <an...@tagish.com>.
Wojtek wrote:

> Hello,
> I am a begginer with xml databases and I have some questions for you. I have
> to work with xindice and acces it from Java level. My first impression is
> that xindice is very slow. Processing any query (xpath) last several
> seconds! Is that correct or just I am doing something wrong?
> Configuration:
> Linux PLD kernel 2.4.20
> Java 1.4.2_01
> xindice - 1.0 standalone

The first thing to do is to switch to 1.1b3.

-- 
Andy Armstrong, Tagish