gustafn
committed
on 11 Nov 18
reduce number of hits in prepared statement nsv cache by using a per-interp cache
/search/search-chunk-oracle.xql (+0 -35)
21 21     </fullquery>
22 22
23 23     <fullquery name="search_one_forum">
24 24         <querytext>
25 25             select forums_messages.*,
26 26                    person.name(forums_messages.user_id) as user_name,
27 27                    to_char(forums_messages.posting_date, 'YYYY-MM-DD HH24:MI:SS') as posting_date_ansi,
28 28                    100 as the_score
29 29             from   forums_messages,
30 30                    forums_forums
31 31             where  forums_forums.forum_id = :forum_id
32 32             and    forums_forums.package_id = :package_id
33 33             and    forums_messages.forum_id = forums_forums.forum_id
34 34             and    forums_messages.state = 'approved'
35 35             and    upper(forums_messages.subject || ' ' || dbms_lob.substr(forums_messages.content,3500) || ' ' || person.name(forums_messages.user_id))
36 36                        like upper(:search_pattern)
37 37             order  by forums_messages.posting_date desc
38 38         </querytext>
39 39     </fullquery>
40 40
41       <fullquery name="search_all_forums_intermedia">
42           <querytext>
43               select forums_messages.*,
44                      person.name(forums_messages.user_id) as user_name,
45                      to_char(forums_messages.posting_date, 'YYYY-MM-DD HH24:MI:SS') as posting_date_ansi,
46                      score(1) as the_score
47               from forums_messages,
48                    forums_forums
49               where forums_messages.forum_id = forums_forums.forum_id
50               and forums_forums.package_id = :package_id
51               and forums_messages.state = 'approved'
52               and contains(forums_messages.content, :search_pattern , 1) > 0
53               order by the_score desc,
54                        forums_messages.posting_date desc
55           </querytext>
56       </fullquery>
57  
58       <fullquery name="search_one_forum_intermedia">
59           <querytext>
60               select forums_messages.*,
61                      person.name(forums_messages.user_id) as user_name,
62                      to_char(forums_messages.posting_date, 'YYYY-MM-DD HH24:MI:SS') as posting_date_ansi,
63                      score(1) as the_score
64               from forums_messages,
65                    forums_forums
66               where forums_forums.forum_id = :forum_id
67               and forums_forums.package_id = :package_id
68               and forums_messages.forum_id = forums_forums.forum_id
69               and forums_messages.state = 'approved'
70               and contains(forums_messages.content, :search_pattern, 1) > 0
71               order by the_score desc,
72                        forums_messages.posting_date desc
73           </querytext>
74       </fullquery>
75  
76 41 </queryset>