Re: [basex-talk] slow processing

2012-10-02 Thread Andreas Weiler
Hi Cerstin,

can you check each single query contained in the script with the GUI and see 
how much time each one takes?

Why are you creating a new session for each query? You should be able to take 
the same session for all queries.

-- Andreas

Am 01.10.2012 um 17:40 schrieb Mahlow Cerstin:

 Hi Andreas,
 
 Am 01.10.2012 um 17:25 schrieb Andreas Weiler:
 
 you can just use it as input for further xquery queries, like this:
 
 index:facets(db, flat)//element[@name = selected]/entry[text() = 
 yes]/@count/data()
 
 so you get the total number of entries with yes.
 
 
 Ah, thanks! Now it works. But almost no speed effect on the whole thing.
 
 Best regards
 
 Cerstin
 -- 
 Dr. phil. Cerstin Mahlow
 
 Universität Basel
 Deutsches Seminar
 Nadelberg 4
 4051 Basel
 Schweiz
 
 Tel:  +41 61 267 07 65
 Fax: +41 61 267 34 40
 Mail: cerstin.mah...@unibas.ch
 Web: http://www.oldphras.net
 
 
 
 
 ___
 BaseX-Talk mailing list
 BaseX-Talk@mailman.uni-konstanz.de
 https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] slow processing

2012-10-02 Thread Cerstin Elisabeth Mahlow
Hi Andreas,

having only one session brings some seconds.

When I run the queries in the GUI on the same server, I get this:

(total number of positive hits)
index:facets(collect, flat)//element[@name = selected]/entry[text() = 
yes]/@count/data()

takes 2 to 4 ms

(number of phrasemes searched)
count(distinct-values(//entry/phraseme/text()))

takes 370 to 500 ms

(create info table)
for $phraseme in distinct-values(//entry/phraseme)
let $nodes  := //phraseme[text() = $phraseme]
let $count  := count($nodes[../selected[text() = yes]])
let $person := distinct-values($nodes/../person)
order by $phraseme  
returntrtd({$phraseme})/td td{$person}/td td{$count}/tdtda 
href=basex-show-phraseme.pl?phraseme={$phraseme}anzeigen/aussortieren/a/td/tr

takes 1000 to 1400 ms

(last timestamp)
let $i := //entry/@time order by $i/@time ascending 
return pLetzte Bearbeitung: {data($i[last()])}/p

takes 250 to 380 ms


However, I just switched to using count() for the number of phrasemes accessed. 
 Before I took the distinct values, splitted them into an array, and then used 
the number of indices. And this probably took a lot of time.  Using count() and 
dropping the splitting results in the page showing up in 2 to 3 seconds. 
Perfect!

Thanks for helping!  I will probably soon will ask for help with another slow 
process :-)

Best regards

Cerstin

--
Dr. phil. Cerstin Mahlow

Universität Basel
Departement Sprach- und Literaturwissenschaften
Fachbereich Deutsche Sprach- und Literaturwissenschaft
Nadelberg 4
4051 Basel
Schweiz

Tel:  +41 61 267 07 65
Fax: +41 61 267 34 40
Mail: cerstin.mah...@unibas.ch
Web: http://www.oldphras.net

Von: Andreas Weiler [andreas.wei...@uni-konstanz.de]
Gesendet: Dienstag, 2. Oktober 2012 10:34
An: Cerstin Elisabeth Mahlow
Cc: basex-talk@mailman.uni-konstanz.de
Betreff: Re: [basex-talk] slow processing

Hi Cerstin,

can you check each single query contained in the script with the GUI and see 
how much time each one takes?

Why are you creating a new session for each query? You should be able to take 
the same session for all queries.

-- Andreas

___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk