Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Staff search for 856 record, flag enabled

kmlussier Jan 5th, 2018 6 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 2018-01-05 16:34:41.101 EST [5158] evergreen@evergreen LOG:  duration: 131.689 ms  statement:         -- bib search: #CD_documentLength #CD_meanHarmonic #CD_uniqueWords #staff core_limit(100000) badge_orgs(1) estimation_strategy(inclusion) skip_check(0) check_limit(1000) adventures in evergreen depth(0)
  2.                 WITH w AS (
  3.  
  4.  
  5.         WITH xd70d138_keyword_xq AS (SELECT
  6.               (to_tsquery('simple', COALESCE(NULLIF( '(' || btrim(regexp_replace(search_normalize(split_date_range($_5157$adventures$_5157$)),E'(?:\\s+|:)','&','g'),'&|')  || ')', '()'), '')) || to_tsquery('english_nostop', COALESCE(NULLIF( '(' || btrim(regexp_replace(search_normalize(split_date_range($_5157$adventures$_5157$)),E'(?:\\s+|:)','&','g'),'&|')  || ')', '()'), '')))&&
  7.               (to_tsquery('english_nostop', COALESCE(NULLIF( '(' || btrim(regexp_replace(search_normalize(split_date_range($_5157$in$_5157$)),E'(?:\\s+|:)','&','g'),'&|')  || ')', '()'), '')) || to_tsquery('simple', COALESCE(NULLIF( '(' || btrim(regexp_replace(search_normalize(split_date_range($_5157$in$_5157$)),E'(?:\\s+|:)','&','g'),'&|')  || ')', '()'), '')))&&
  8.               (to_tsquery('simple', COALESCE(NULLIF( '(' || btrim(regexp_replace(search_normalize(split_date_range($_5157$evergreen$_5157$)),E'(?:\\s+|:)','&','g'),'&|')  || ')', '()'), '')) || to_tsquery('english_nostop', COALESCE(NULLIF( '(' || btrim(regexp_replace(search_normalize(split_date_range($_5157$evergreen$_5157$)),E'(?:\\s+|:)','&','g'),'&|')  || ')', '()'), ''))) AS tsq,
  9.               (to_tsquery('simple', COALESCE(NULLIF( '(' || btrim(regexp_replace(search_normalize(split_date_range($_5157$adventures$_5157$)),E'(?:\\s+|:)','&','g'),'&|')  || ')', '()'), '')) || to_tsquery('english_nostop', COALESCE(NULLIF( '(' || btrim(regexp_replace(search_normalize(split_date_range($_5157$adventures$_5157$)),E'(?:\\s+|:)','&','g'),'&|')  || ')', '()'), ''))) ||
  10.               (to_tsquery('english_nostop', COALESCE(NULLIF( '(' || btrim(regexp_replace(search_normalize(split_date_range($_5157$in$_5157$)),E'(?:\\s+|:)','&','g'),'&|')  || ')', '()'), '')) || to_tsquery('simple', COALESCE(NULLIF( '(' || btrim(regexp_replace(search_normalize(split_date_range($_5157$in$_5157$)),E'(?:\\s+|:)','&','g'),'&|')  || ')', '()'), ''))) ||
  11.               (to_tsquery('simple', COALESCE(NULLIF( '(' || btrim(regexp_replace(search_normalize(split_date_range($_5157$evergreen$_5157$)),E'(?:\\s+|:)','&','g'),'&|')  || ')', '()'), '')) || to_tsquery('english_nostop', COALESCE(NULLIF( '(' || btrim(regexp_replace(search_normalize(split_date_range($_5157$evergreen$_5157$)),E'(?:\\s+|:)','&','g'),'&|')  || ')', '()'), ''))) AS tsq_rank ),lang_with AS (SELECT id FROM config.coded_value_map WHERE ctype = 'item_lang' AND code = $_5157$eng$_5157$),        pop_with AS (
  12.                     SELECT  record,
  13.                             ARRAY_AGG(badge) AS badges,
  14.                             SUM(s.score::NUMERIC*b.weight::NUMERIC)/SUM(b.weight::NUMERIC) AS total_score
  15.                       FROM  rating.record_badge_score s
  16.                             JOIN rating.badge b ON (
  17.                                 b.id = s.badge
  18.          AND b.scope = ANY ('{1}')) GROUP BY 1)
  19.         ,c_attr AS (SELECT (ARRAY_TO_STRING(ARRAY[search.calculate_visibility_attribute_test('circ_lib','{1,2,3,4,5,6,7,8,9}',FALSE)],'&'))::query_int AS vis_test FROM asset.patron_default_visibility_mask() x)
  20.         ,b_attr AS (SELECT (ARRAY_TO_STRING(ARRAY[search.calculate_visibility_attribute_test('luri_org','{1}',FALSE)],'&'))::query_int AS vis_test FROM asset.patron_default_visibility_mask() x)
  21.         SELECT  id,
  22.                 rel,
  23.                 CASE WHEN cardinality(records) = 1 THEN records[1] ELSE NULL END AS record,
  24.                 NULL::INT AS total,
  25.                 NULL::INT AS checked,
  26.                 NULL::INT AS visible,
  27.                 NULL::INT AS deleted,
  28.                 NULL::INT AS excluded,
  29.                 badges,
  30.                 popularity
  31.           FROM  (SELECT m.source AS id,
  32.                         ARRAY[m.source] AS records,
  33.                         (AVG(
  34.                   (COALESCE(ts_rank_cd('{0.1, 0.2, 0.4, 1.0}', xd70d138_keyword.index_vector, xd70d138_keyword.tsq_rank, 14) * xd70d138_keyword.weight, 0.0)
  35.                   * evergreen.rel_bump(('{' || quote_literal(search_normalize($_5157$adventures$_5157$)) || ',' || quote_literal(search_normalize($_5157$in$_5157$)) || ',' || quote_literal(search_normalize($_5157$evergreen$_5157$)) || '}')::TEXT[], xd70d138_keyword.value, '{word_order}'::TEXT[], '{10}'::NUMERIC[]))
  36.                 )+1 * COALESCE( NULLIF( FIRST(mrv.vlist @> ARRAY[lang_with.id]), FALSE )::INT * 5, 1))::NUMERIC AS rel,
  37.                         1.0/((AVG(
  38.                   (COALESCE(ts_rank_cd('{0.1, 0.2, 0.4, 1.0}', xd70d138_keyword.index_vector, xd70d138_keyword.tsq_rank, 14) * xd70d138_keyword.weight, 0.0)
  39.                   * evergreen.rel_bump(('{' || quote_literal(search_normalize($_5157$adventures$_5157$)) || ',' || quote_literal(search_normalize($_5157$in$_5157$)) || ',' || quote_literal(search_normalize($_5157$evergreen$_5157$)) || '}')::TEXT[], xd70d138_keyword.value, '{word_order}'::TEXT[], '{10}'::NUMERIC[]))
  40.                 )+1 * COALESCE( NULLIF( FIRST(mrv.vlist @> ARRAY[lang_with.id]), FALSE )::INT * 5, 1)))::NUMERIC AS rank,
  41.                         FIRST(pubdate_t.value) AS tie_break,
  42.                         STRING_AGG(ARRAY_TO_STRING(pop_with.badges,','),',') AS badges,
  43.                         AVG(COALESCE(pop_with.total_score::NUMERIC,0.0::NUMERIC))::NUMERIC(2,1) AS popularity
  44.                   FROM  metabib.metarecord_source_map m
  45.  
  46.                 LEFT JOIN (
  47.                   SELECT fe.*, fe_weight.weight, xd70d138_keyword_xq.tsq, xd70d138_keyword_xq.tsq_rank /* search */
  48.                     FROM  metabib.keyword_field_entry AS fe
  49.                       JOIN config.metabib_field AS fe_weight ON (fe_weight.id = fe.field)
  50.                     JOIN xd70d138_keyword_xq ON (fe.index_vector @@ xd70d138_keyword_xq.tsq)
  51.                 ) AS xd70d138_keyword ON (m.source = xd70d138_keyword.source)
  52.  
  53.                         INNER JOIN metabib.record_attr_vector_list mrv ON m.source = mrv.source
  54.                         INNER JOIN biblio.record_entry bre ON m.source = bre.id
  55.                         LEFT JOIN pop_with ON ( m.source = pop_with.record )
  56.                         LEFT JOIN metabib.record_sorter pubdate_t ON m.source = pubdate_t.source AND attr = 'pubdate'
  57.                         ,lang_with
  58.                         ,c_attr
  59.                         ,b_attr
  60.                   WHERE 1=1
  61.                         AND (
  62.                   (xd70d138_keyword.id IS NOT NULL)
  63.                 )
  64.                 AND (
  65.                   ((EXISTS (SELECT 1 FROM asset.copy_vis_attr_cache WHERE record = m.source AND vis_attr_vector @@ c_attr.vis_test) OR (NOT EXISTS (SELECT 1 FROM asset.copy_vis_attr_cache WHERE record = m.source) AND (bre.vis_attr_vector IS NULL OR NOT ( int4range(0,268435455,'[]') @> ANY(bre.vis_attr_vector) ))))) OR ((b_attr.vis_test IS NULL OR bre.vis_attr_vector @@ b_attr.vis_test))
  66.                 )
  67.                   GROUP BY 1
  68.                   ORDER BY 4 ASC NULLS LAST,  5 DESC NULLS LAST, 3 DESC
  69.                   LIMIT 100000
  70.                 ) AS core_query
  71.         ) (SELECT * FROM w LIMIT 1000 OFFSET 0)
  72.                 UNION ALL
  73.           SELECT NULL,NULL,NULL,COUNT(*),COUNT(*),COUNT(*),0,0,NULL,NULL FROM w;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top