source: trunk/www/views/experiments/explorer/search/index.jsp @ 5711

Last change on this file since 5711 was 5711, checked in by Nicklas Nordborg, 10 years ago

References #1618: Improve "Reporter search" performance in experiment explorer

Different implementation on "Reporter search" that uses the cached reporter ids and use a regular query against the Reporters table only. As a result, the "Create reporter list" function needed to fixed as it can no longer use the query. Instead it also uses the cached reporter ids.

Added filter condition for bioassays when loading the "Reporter view" page since it seems to be a lot quicker (see comment 4).

Fixed an issue with generating incorrect SQL when filtering on a reporter list. I think this broke as part of #903, but has gone unnoticed since then. A join to the reporter list table was missing due to no auto-join support in DynamicPositionQuery and DynamicReporterQuery. Auto-join support has now been added to those query implementations.

Everything is a lot quicker now on my development machine. I have 2.5M reporters in the reporter table and an experiment with 24M rows of spot data in 500 bioassays. So far no action seems to take more than a couple of seconds to complete.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 3.3 KB
Line 
1<%-- $Id: index.jsp 5711 2011-08-30 13:49:58Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) 2006 Nicklas Nordborg
4
5  This file is part of BASE - BioArray Software Environment.
6  Available at http://base.thep.lu.se/
7
8  This file is part of BASE.
9
10  BASE is free software; you can redistribute it and/or
11  modify it under the terms of the GNU General Public License
12  as published by the Free Software Foundation; either version 3
13  of the License, or (at your option) any later version.
14
15  BASE is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  GNU General Public License for more details.
19
20  You should have received a copy of the GNU General Public License
21  along with BASE. If not, see <http://www.gnu.org/licenses/>.
22  ------------------------------------------------------------------
23
24  @author Nicklas
25  @version 2.0
26--%>
27<%@ page pageEncoding="UTF-8" session="false"
28  import="net.sf.basedb.core.SessionControl"
29  import="net.sf.basedb.core.DbControl"
30  import="net.sf.basedb.core.Item"
31  import="net.sf.basedb.core.ItemContext"
32  import="net.sf.basedb.core.BioAssaySet"
33  import="net.sf.basedb.core.DynamicReporterQuery"
34  import="net.sf.basedb.clients.web.Base"
35  import="net.sf.basedb.clients.web.ExperimentExplorer"
36  import="net.sf.basedb.clients.web.WebException"
37  import="net.sf.basedb.util.Values"
38  import="net.sf.basedb.clients.web.util.HTML"
39  import="java.util.Collections"
40%>
41<%
42final int bioAssaySetId = Values.getInt(request.getParameter("bioassayset_id"));
43final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
44final String ID = sc.getId();
45final String cmd = request.getParameter("cmd");
46final String root = request.getContextPath()+"/";
47
48final String listPage = "list.jsp?ID="+ID+"&bioassayset_id="+bioAssaySetId;
49
50String forward = null;
51String redirect = null;
52String message = null;
53
54DbControl dc = null;
55try
56{
57  dc = sc.newDbControl();
58  BioAssaySet bioAssaySet = BioAssaySet.getById(dc, bioAssaySetId);
59  ExperimentExplorer explorer = ExperimentExplorer.getExplorer(bioAssaySet);
60  if (cmd == null || "List".equals(cmd))
61  {
62    ItemContext cc = explorer.getAndSetReporterContext(sc, null);
63    redirect = listPage;
64  }
65  else if ("UpdateContext".equals(cmd))
66  {
67    ItemContext cc = explorer.getAndSetReporterContext(sc, pageContext);
68    redirect = listPage;
69  }
70  else if ("CreateReporterList".equals(cmd))
71  {
72    ItemContext cc = explorer.getAndSetReporterContext(sc, pageContext);
73    cc.setObject("reporter-list-creator", explorer);
74    redirect = "../../../reporterlists/index.jsp?ID="+ID+
75        "&cmd=NewItem&addReporters=1&formId=reporters&fromContext=" + cc.getItemType().name() + 
76        "&subContext="+cc.getSubContext() + "&name=" + HTML.urlEncode(bioAssaySet.getName());
77  }
78
79  else
80  {
81    throw new WebException("popup", "Invalid command", "The command {1} is not recognised as a valid command.", cmd);
82  }
83}
84finally
85{
86  if (dc != null) dc.close();
87}
88if (forward != null)
89{
90  pageContext.forward(forward);
91}
92else if (redirect != null)
93{
94  response.sendRedirect(redirect);
95}
96else if (message == null)
97{
98  response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=1&wait=0");
99}
100else
101{
102  response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=1&message="+HTML.urlEncode(message));
103}
104
105%>
106
107
108
109
Note: See TracBrowser for help on using the repository browser.