[ 
https://jira.duraspace.org/browse/DS-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=26108#comment-26108
 ] 

Andrea Bollini commented on DS-1223:
------------------------------------

it looks as the problem was what I suspect, you need to limit the left side 
before make the join.
The final query (in postgres) that you need to run is

select browsepag.*, count(item_id) from 
--- below the "orginal" query as subquery to use in join
(SELECT bi_2_dis.* FROM bi_2_dis ORDER BY sort_value ASC NULLS LAST LIMIT 20) 
as browsepag 
left join bi_2_dmap as freq on browsepag.distinct_id = freq.distinct_id
group by browsepag.id, browsepag.distinct_id, browsepag.authority, 
browsepag.value, browsepag.sort_value
-- it is important to re-order the result
ORDER BY sort_value ASC NULLS  LAST

in my test environments 4000 distinct authors and 8400 items the query with 
frequencies count require 1ms more (23ms vs 22ms)

Can you check this query in your test environment and make the required code 
modification?
                
> Display frequencies of items in single browsing for selected indices
> --------------------------------------------------------------------
>
>                 Key: DS-1223
>                 URL: https://jira.duraspace.org/browse/DS-1223
>             Project: DSpace
>          Issue Type: Improvement
>          Components: JSPUI
>    Affects Versions: 1.8.2
>            Reporter: Christina Paschou
>              Labels: has-patch, has-pull-request
>         Attachments: browse_frequencies.diff, README.txt
>
>
> DSpace provides by default two types of browsing, naming them single browsing 
> and full browsing according to the corresponding names of the .jsp files that 
> are responsible for handling each request (single.jsp & full.jsp). 
> Each type of browsing is defined accordingly and configured in different way 
> in the configuration file dspace.cfg.  
> The proposed improvement is applied for the case of browsing by a unique 
> index of metadata values from the item (single browsing). In this case, the 
> user can define for each metadata browse index whether he wishes to add next 
> to its various metadata values the frequencies of items that are included. 
> The configuration takes place in the dspace.cfg.
> Examples: 
> http://phdtheses.ekt.gr/eadd/browse?type=subject
> http://phdtheses.ekt.gr/eadd/browse?type=country
> http://phdtheses.ekt.gr/eadd/browse?type=language
> Attached you can find the patch file and a readme file with details about tha 
> configuration that is needed to be made.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to