OSDN Git Service

6ccc4ce0f9d4585233e1552d1fd1e898cab6de6e
[pgbigm/pg_bigm.git] / expected / pg_bigm.out
1 CREATE EXTENSION pg_bigm;
2 \pset null '(null)'
3 SET standard_conforming_strings = on;
4 SET escape_string_warning = off;
5 SET enable_seqscan = off;
6 SET pg_bigm.enable_recheck = on;
7 SET pg_bigm.gin_key_limit = 0;
8 SET pg_bigm.similarity_limit = 0.02;
9 -- tests for pg_bigm.last_update
10 SHOW pg_bigm.last_update;
11  pg_bigm.last_update 
12 ---------------------
13  2013.11.22
14 (1 row)
15
16 SET pg_bigm.last_update = '2013.09.18';
17 ERROR:  parameter "pg_bigm.last_update" cannot be changed
18 -- tests for likequery
19 SELECT likequery(NULL);
20  likequery 
21 -----------
22  (null)
23 (1 row)
24
25 SELECT likequery('');
26  likequery 
27 -----------
28  (null)
29 (1 row)
30
31 SELECT likequery('  ');
32  likequery 
33 -----------
34  %  %
35 (1 row)
36
37 SELECT likequery('aBc023#*^&');
38   likequery   
39 --------------
40  %aBc023#*^&%
41 (1 row)
42
43 SELECT likequery('\_%');
44  likequery 
45 -----------
46  %\\\_\%%
47 (1 row)
48
49 -- tests for show_bigm
50 SELECT show_bigm(NULL);
51  show_bigm 
52 -----------
53  (null)
54 (1 row)
55
56 SELECT show_bigm('');
57  show_bigm 
58 -----------
59  {}
60 (1 row)
61
62 SELECT show_bigm('i');
63   show_bigm  
64 -------------
65  {" i","i "}
66 (1 row)
67
68 SELECT show_bigm('ab');
69    show_bigm    
70 ----------------
71  {" a",ab,"b "}
72 (1 row)
73
74 SELECT show_bigm('aBc023$&^');
75               show_bigm              
76 -------------------------------------
77  {" a",$&,&^,02,23,3$,Bc,"^ ",aB,c0}
78 (1 row)
79
80 SELECT show_bigm('\_%');
81        show_bigm       
82 -----------------------
83  {" \\","% ","\\_",_%}
84 (1 row)
85
86 SELECT show_bigm('  ');
87  show_bigm 
88 -----------
89  {}
90 (1 row)
91
92 SELECT show_bigm('pg_bigm improves performance by 200%');
93                                                             show_bigm                                                            
94 ---------------------------------------------------------------------------------------------------------------------------------
95  {" 2"," b"," i"," p","% ",0%,00,20,_b,an,bi,by,ce,"e ",er,es,fo,g_,gm,ig,im,"m ",ma,mp,nc,or,ov,pe,pg,pr,rf,rm,ro,"s ",ve,"y "}
96 (1 row)
97
98 -- tests for creation of full-text search index
99 CREATE TABLE test_bigm (col1 text, col2 text);
100 CREATE INDEX test_bigm_idx ON test_bigm
101                          USING gin (col1 gin_bigm_ops, col2 gin_bigm_ops);
102 \copy test_bigm from 'data/bigm.csv' with csv
103 -- tests pg_gin_pending_stats
104 SELECT * FROM pg_gin_pending_stats('test_bigm_idx');
105  pages | tuples 
106 -------+--------
107     43 |    249
108 (1 row)
109
110 VACUUM;
111 SELECT * FROM pg_gin_pending_stats('test_bigm_idx');
112  pages | tuples 
113 -------+--------
114      0 |      0
115 (1 row)
116
117 SELECT * FROM pg_gin_pending_stats('test_bigm');
118 ERROR:  relation "test_bigm" is not a GIN index
119 CREATE INDEX test_bigm_btree ON test_bigm USING btree (col2);
120 SELECT * FROM pg_gin_pending_stats('test_bigm_btree');
121 ERROR:  relation "test_bigm_btree" is not a GIN index
122 DROP INDEX test_bigm_btree;
123 -- tests for full-text search
124 EXPLAIN (COSTS off) SELECT * FROM test_bigm WHERE col1 LIKE likequery('a');
125                 QUERY PLAN                 
126 -------------------------------------------
127  Bitmap Heap Scan on test_bigm
128    Recheck Cond: (col1 ~~ '%a%'::text)
129    ->  Bitmap Index Scan on test_bigm_idx
130          Index Cond: (col1 ~~ '%a%'::text)
131 (4 rows)
132
133 EXPLAIN (COSTS off) SELECT * FROM test_bigm WHERE col1 LIKE likequery('am');
134                  QUERY PLAN                 
135 --------------------------------------------
136  Bitmap Heap Scan on test_bigm
137    Recheck Cond: (col1 ~~ '%am%'::text)
138    ->  Bitmap Index Scan on test_bigm_idx
139          Index Cond: (col1 ~~ '%am%'::text)
140 (4 rows)
141
142 EXPLAIN (COSTS off) SELECT * FROM test_bigm WHERE col1 LIKE likequery('XML');
143                  QUERY PLAN                  
144 ---------------------------------------------
145  Bitmap Heap Scan on test_bigm
146    Recheck Cond: (col1 ~~ '%XML%'::text)
147    ->  Bitmap Index Scan on test_bigm_idx
148          Index Cond: (col1 ~~ '%XML%'::text)
149 (4 rows)
150
151 EXPLAIN (COSTS off) SELECT * FROM test_bigm WHERE col1 LIKE likequery('bigm');
152                   QUERY PLAN                  
153 ----------------------------------------------
154  Bitmap Heap Scan on test_bigm
155    Recheck Cond: (col1 ~~ '%bigm%'::text)
156    ->  Bitmap Index Scan on test_bigm_idx
157          Index Cond: (col1 ~~ '%bigm%'::text)
158 (4 rows)
159
160 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery(NULL);
161  col1 
162 ------
163 (0 rows)
164
165 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('');
166  col1 
167 ------
168 (0 rows)
169
170 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('%');
171                              col1                              
172 ---------------------------------------------------------------
173  Sets the similarity threshold used by the =% operator.
174  pg_bigm has improved the full text search performance by 200%
175 (2 rows)
176
177 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('\');
178                               col1                              
179 ----------------------------------------------------------------
180  Sets whether "\'" is allowed in string literals.
181  \dx displays list of installed extensions
182  \w FILE outputs the current query buffer to the file specified
183 (3 rows)
184
185 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('_');
186                                       col1                                      
187 --------------------------------------------------------------------------------
188  Allows archiving of WAL files using archive_command.
189  Sets the minimum concurrent open transactions before performing commit_delay.
190  Shows the last update date of pg_bigm.
191  Sets the size reserved for pg_stat_activity.query, in bytes.
192  pg_trgm -  Tool that provides 3-gram full text search capability in PostgreSQL
193  pg_bigm -  Tool that provides 2-gram full text search capability in PostgreSQL
194  pg_bigm has improved the full text search performance by 200%
195 (7 rows)
196
197 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('\dx');
198                    col1                    
199 -------------------------------------------
200  \dx displays list of installed extensions
201 (1 row)
202
203 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('pg_bigm');
204                                       col1                                      
205 --------------------------------------------------------------------------------
206  Shows the last update date of pg_bigm.
207  pg_bigm -  Tool that provides 2-gram full text search capability in PostgreSQL
208  pg_bigm has improved the full text search performance by 200%
209 (3 rows)
210
211 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('200%');
212                              col1                              
213 ---------------------------------------------------------------
214  pg_bigm has improved the full text search performance by 200%
215 (1 row)
216
217 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('  ');
218                                       col1                                      
219 --------------------------------------------------------------------------------
220  pg_trgm -  Tool that provides 3-gram full text search capability in PostgreSQL
221  pg_bigm -  Tool that provides 2-gram full text search capability in PostgreSQL
222 (2 rows)
223
224 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('Y');
225                                col1                               
226 ------------------------------------------------------------------
227  Generates debugging output for LISTEN and NOTIFY.
228  You can create an index for full text search by using GIN index.
229  You will get into deep trouble for staying out late
230 (3 rows)
231
232 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('pi');
233                              col1                             
234 --------------------------------------------------------------
235  Vacuum cost amount available before napping, for autovacuum.
236  Vacuum cost amount available before napping.
237 (2 rows)
238
239 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('GIN');
240                                      col1                                     
241 ------------------------------------------------------------------------------
242  Sets the maximum allowed result for exact search by GIN.
243  Sets the maximum number of bi-gram keys allowed to use for GIN index search.
244  You can create an index for full text search by using GIN index.
245 (3 rows)
246
247 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('gin');
248                             col1                            
249 ------------------------------------------------------------
250  Generates debugging output for LISTEN and NOTIFY.
251  Enables logging of recovery-related debugging information.
252 (2 rows)
253
254 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('Tool');
255                                       col1                                      
256 --------------------------------------------------------------------------------
257  pg_trgm -  Tool that provides 3-gram full text search capability in PostgreSQL
258  pg_bigm -  Tool that provides 2-gram full text search capability in PostgreSQL
259 (2 rows)
260
261 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('performance');
262                              col1                              
263 ---------------------------------------------------------------
264  Writes executor performance statistics to the server log.
265  Writes parser performance statistics to the server log.
266  Writes planner performance statistics to the server log.
267  Writes cumulative performance statistics to the server log.
268  pg_bigm has improved the full text search performance by 200%
269 (5 rows)
270
271 -- check that the search results don't change if enable_recheck is disabled
272 -- in order to check that index full search is NOT executed
273 SET pg_bigm.enable_recheck = off;
274 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('Y');
275                                col1                               
276 ------------------------------------------------------------------
277  Generates debugging output for LISTEN and NOTIFY.
278  You can create an index for full text search by using GIN index.
279  You will get into deep trouble for staying out late
280 (3 rows)
281
282 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('pi');
283                              col1                             
284 --------------------------------------------------------------
285  Vacuum cost amount available before napping, for autovacuum.
286  Vacuum cost amount available before napping.
287 (2 rows)
288
289 SET pg_bigm.enable_recheck = on;
290 EXPLAIN (COSTS off) SELECT col1 FROM test_bigm WHERE col1 LIKE '%bigm%';
291                   QUERY PLAN                  
292 ----------------------------------------------
293  Bitmap Heap Scan on test_bigm
294    Recheck Cond: (col1 ~~ '%bigm%'::text)
295    ->  Bitmap Index Scan on test_bigm_idx
296          Index Cond: (col1 ~~ '%bigm%'::text)
297 (4 rows)
298
299 SELECT col1 FROM test_bigm WHERE col1 LIKE '%Tool%';
300                                       col1                                      
301 --------------------------------------------------------------------------------
302  pg_trgm -  Tool that provides 3-gram full text search capability in PostgreSQL
303  pg_bigm -  Tool that provides 2-gram full text search capability in PostgreSQL
304 (2 rows)
305
306 EXPLAIN (COSTS off) SELECT col1 FROM test_bigm WHERE col1 LIKE '%\%';
307                 QUERY PLAN                 
308 -------------------------------------------
309  Bitmap Heap Scan on test_bigm
310    Recheck Cond: (col1 ~~ '%\%'::text)
311    ->  Bitmap Index Scan on test_bigm_idx
312          Index Cond: (col1 ~~ '%\%'::text)
313 (4 rows)
314
315 SELECT col1 FROM test_bigm WHERE col1 LIKE '%\%';
316                              col1                              
317 ---------------------------------------------------------------
318  Sets the similarity threshold used by the =% operator.
319  pg_bigm has improved the full text search performance by 200%
320 (2 rows)
321
322 EXPLAIN (COSTS off) SELECT col1 FROM test_bigm WHERE col1 LIKE 'pg\___gm%';
323                    QUERY PLAN                    
324 -------------------------------------------------
325  Bitmap Heap Scan on test_bigm
326    Recheck Cond: (col1 ~~ 'pg\___gm%'::text)
327    ->  Bitmap Index Scan on test_bigm_idx
328          Index Cond: (col1 ~~ 'pg\___gm%'::text)
329 (4 rows)
330
331 SELECT col1 FROM test_bigm WHERE col1 LIKE 'pg\___gm%';
332                                       col1                                      
333 --------------------------------------------------------------------------------
334  pg_trgm -  Tool that provides 3-gram full text search capability in PostgreSQL
335  pg_bigm -  Tool that provides 2-gram full text search capability in PostgreSQL
336  pg_bigm has improved the full text search performance by 200%
337 (3 rows)
338
339 -- tests for pg_bigm.enable_recheck
340 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('trial');
341          col1         
342 ----------------------
343  He is awaiting trial
344 (1 row)
345
346 SET pg_bigm.enable_recheck = off;
347 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('trial');
348                                                           col1                                                           
349 -------------------------------------------------------------------------------------------------------------------------
350  Whether to defer a read-only serializable transaction until it can be executed with no possible serialization failures.
351  He is awaiting trial
352  It was a trivial mistake
353 (3 rows)
354
355 -- tests for pg_bigm.gin_key_limit
356 SELECT count(*) FROM test_bigm WHERE col1 LIKE likequery('she tore');
357  count 
358 -------
359      2
360 (1 row)
361
362 SET pg_bigm.gin_key_limit = 6;
363 SELECT count(*) FROM test_bigm WHERE col1 LIKE likequery('she tore');
364  count 
365 -------
366      5
367 (1 row)
368
369 SET pg_bigm.gin_key_limit = 5;
370 SELECT count(*) FROM test_bigm WHERE col1 LIKE likequery('she tore');
371  count 
372 -------
373     30
374 (1 row)
375
376 SET pg_bigm.gin_key_limit = 4;
377 SELECT count(*) FROM test_bigm WHERE col1 LIKE likequery('she tore');
378  count 
379 -------
380     70
381 (1 row)
382
383 SET pg_bigm.gin_key_limit = 3;
384 SELECT count(*) FROM test_bigm WHERE col1 LIKE likequery('she tore');
385  count 
386 -------
387    164
388 (1 row)
389
390 SET pg_bigm.gin_key_limit = 2;
391 SELECT count(*) FROM test_bigm WHERE col1 LIKE likequery('she tore');
392  count 
393 -------
394    188
395 (1 row)
396
397 SET pg_bigm.gin_key_limit = 1;
398 SELECT count(*) FROM test_bigm WHERE col1 LIKE likequery('she tore');
399  count 
400 -------
401    199
402 (1 row)
403
404 SET pg_bigm.enable_recheck = on;
405 SET pg_bigm.gin_key_limit = 0;
406 -- tests with standard_conforming_strings disabled
407 SET standard_conforming_strings = off;
408 SELECT likequery('\\_%');
409  likequery 
410 -----------
411  %\\\_\%%
412 (1 row)
413
414 SELECT show_bigm('\\_%');
415        show_bigm       
416 -----------------------
417  {" \\","% ","\\_",_%}
418 (1 row)
419
420 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('\\');
421                               col1                              
422 ----------------------------------------------------------------
423  Sets whether "\'" is allowed in string literals.
424  \dx displays list of installed extensions
425  \w FILE outputs the current query buffer to the file specified
426 (3 rows)
427
428 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('\\dx');
429                    col1                    
430 -------------------------------------------
431  \dx displays list of installed extensions
432 (1 row)
433
434 SELECT col1 FROM test_bigm WHERE col1 LIKE likequery('200%');
435                              col1                              
436 ---------------------------------------------------------------
437  pg_bigm has improved the full text search performance by 200%
438 (1 row)
439
440 -- tests for full text search with multi-column index
441 -- keyword exists only in col1. Query on col2 must not return any rows.
442 EXPLAIN (COSTS off) SELECT * FROM test_bigm WHERE col2 LIKE likequery('queries');
443                    QUERY PLAN                    
444 -------------------------------------------------
445  Bitmap Heap Scan on test_bigm
446    Recheck Cond: (col2 ~~ '%queries%'::text)
447    ->  Bitmap Index Scan on test_bigm_idx
448          Index Cond: (col2 ~~ '%queries%'::text)
449 (4 rows)
450
451 SELECT * FROM test_bigm WHERE col2 LIKE likequery('queries');
452  col1 | col2 
453 ------+------
454 (0 rows)
455
456 -- keyword exists only in col2. All rows with keyword in col2 are returned.
457 EXPLAIN (COSTS off) SELECT * FROM test_bigm WHERE col2 LIKE likequery('meta');
458                   QUERY PLAN                  
459 ----------------------------------------------
460  Bitmap Heap Scan on test_bigm
461    Recheck Cond: (col2 ~~ '%meta%'::text)
462    ->  Bitmap Index Scan on test_bigm_idx
463          Index Cond: (col2 ~~ '%meta%'::text)
464 (4 rows)
465
466 SELECT * FROM test_bigm WHERE col2 LIKE likequery('meta');
467                               col1                              |     col2     
468 ----------------------------------------------------------------+--------------
469  \dx displays list of installed extensions                      | meta command
470  \w FILE outputs the current query buffer to the file specified | meta command
471 (2 rows)
472
473 -- keyword exists in both columns. Query on col1 must not return rows with keyword in col2 only.
474 EXPLAIN (COSTS off) SELECT * FROM test_bigm WHERE col1 LIKE likequery('bigm');
475                   QUERY PLAN                  
476 ----------------------------------------------
477  Bitmap Heap Scan on test_bigm
478    Recheck Cond: (col1 ~~ '%bigm%'::text)
479    ->  Bitmap Index Scan on test_bigm_idx
480          Index Cond: (col1 ~~ '%bigm%'::text)
481 (4 rows)
482
483 SELECT * FROM test_bigm WHERE col1 LIKE likequery('bigm');
484                                       col1                                      |        col2         
485 --------------------------------------------------------------------------------+---------------------
486  Shows the last update date of pg_bigm.                                         | pg_bigm.last_update
487  pg_bigm -  Tool that provides 2-gram full text search capability in PostgreSQL | pg_bigm
488  pg_bigm has improved the full text search performance by 200%                  | pg_bigm performance
489 (3 rows)
490
491 -- tests for bigm_similarity
492 SELECT bigm_similarity('wow', NULL);
493  bigm_similarity 
494 -----------------
495           (null)
496 (1 row)
497
498 SELECT bigm_similarity('wow', '');
499  bigm_similarity 
500 -----------------
501                0
502 (1 row)
503
504 SELECT bigm_similarity('wow', 'WOWa ');
505  bigm_similarity 
506 -----------------
507                0
508 (1 row)
509
510 SELECT bigm_similarity('wow', ' WOW ');
511  bigm_similarity 
512 -----------------
513                0
514 (1 row)
515
516 SELECT bigm_similarity('wow', ' wow ');
517  bigm_similarity 
518 -----------------
519                1
520 (1 row)
521
522 SELECT bigm_similarity('---', '####---');
523  bigm_similarity 
524 -----------------
525              0.4
526 (1 row)
527
528 -- tests for text similarity serach
529 EXPLAIN (COSTS off) SELECT * FROM test_bigm WHERE col1 =% 'a';
530                 QUERY PLAN                
531 ------------------------------------------
532  Bitmap Heap Scan on test_bigm
533    Recheck Cond: (col1 =% 'a'::text)
534    ->  Bitmap Index Scan on test_bigm_idx
535          Index Cond: (col1 =% 'a'::text)
536 (4 rows)
537
538 EXPLAIN (COSTS off) SELECT * FROM test_bigm WHERE col1 =% 'am';
539                 QUERY PLAN                
540 ------------------------------------------
541  Bitmap Heap Scan on test_bigm
542    Recheck Cond: (col1 =% 'am'::text)
543    ->  Bitmap Index Scan on test_bigm_idx
544          Index Cond: (col1 =% 'am'::text)
545 (4 rows)
546
547 EXPLAIN (COSTS off) SELECT * FROM test_bigm WHERE col1 =% 'XML';
548                 QUERY PLAN                 
549 -------------------------------------------
550  Bitmap Heap Scan on test_bigm
551    Recheck Cond: (col1 =% 'XML'::text)
552    ->  Bitmap Index Scan on test_bigm_idx
553          Index Cond: (col1 =% 'XML'::text)
554 (4 rows)
555
556 EXPLAIN (COSTS off) SELECT * FROM test_bigm WHERE col1 =% 'bigm';
557                  QUERY PLAN                 
558 --------------------------------------------
559  Bitmap Heap Scan on test_bigm
560    Recheck Cond: (col1 =% 'bigm'::text)
561    ->  Bitmap Index Scan on test_bigm_idx
562          Index Cond: (col1 =% 'bigm'::text)
563 (4 rows)
564
565 SELECT col1 FROM test_bigm WHERE col1 =% NULL;
566  col1 
567 ------
568 (0 rows)
569
570 SELECT col1 FROM test_bigm WHERE col1 =% '';
571  col1 
572 ------
573 (0 rows)
574
575 SELECT col1 FROM test_bigm WHERE col1 =% '%';
576                           col1                          
577 --------------------------------------------------------
578  Sets the similarity threshold used by the =% operator.
579 (1 row)
580
581 SELECT col1 FROM test_bigm WHERE col1 =% '\\';
582                    col1                    
583 -------------------------------------------
584  \dx displays list of installed extensions
585 (1 row)
586
587 SELECT col1 FROM test_bigm WHERE col1 =% '_';
588  col1 
589 ------
590 (0 rows)
591
592 SELECT col1 FROM test_bigm WHERE col1 =% '\\dx';
593                              col1                             
594 --------------------------------------------------------------
595  Shows the maximum number of index keys.
596  Recheck that heap tuples fetched from index match the query.
597  \dx displays list of installed extensions
598 (3 rows)
599
600 SELECT col1 FROM test_bigm WHERE col1 =% '200%';
601                              col1                              
602 ---------------------------------------------------------------
603  Sets the similarity threshold used by the =% operator.
604  pg_bigm has improved the full text search performance by 200%
605 (2 rows)
606
607 SELECT col1 FROM test_bigm WHERE col1 =% '  ';
608  col1 
609 ------
610 (0 rows)
611
612 SELECT count(*), min(bigm_similarity(col1, 'Y')) FROM test_bigm WHERE col1 =% 'Y';
613  count |    min    
614 -------+-----------
615      1 | 0.0212766
616 (1 row)
617
618 SELECT count(*), max(bigm_similarity(col1, 'Y')) FROM test_bigm WHERE NOT col1 =% 'Y';
619  count |    max    
620 -------+-----------
621    248 | 0.0192308
622 (1 row)
623
624 SELECT count(*), min(bigm_similarity(col1, 'pi')) FROM test_bigm WHERE col1 =% 'pi';
625  count | min  
626 -------+------
627     52 | 0.02
628 (1 row)
629
630 SELECT count(*), max(bigm_similarity(col1, 'pi')) FROM test_bigm WHERE NOT col1 =% 'pi';
631  count |    max    
632 -------+-----------
633    197 | 0.0196078
634 (1 row)
635
636 SET pg_bigm.similarity_limit = 0.06;
637 SELECT count(*), min(bigm_similarity(col1, 'GIN')) FROM test_bigm WHERE col1 =% 'GIN';
638  count |    min    
639 -------+-----------
640      1 | 0.0769231
641 (1 row)
642
643 SELECT count(*), max(bigm_similarity(col1, 'GIN')) FROM test_bigm WHERE NOT col1 =% 'GIN';
644  count |    max    
645 -------+-----------
646    248 | 0.0571429
647 (1 row)
648
649 SELECT count(*), min(bigm_similarity(col1, 'gin')) FROM test_bigm WHERE col1 =% 'gin';
650  count |    min    
651 -------+-----------
652      5 | 0.0606061
653 (1 row)
654
655 SELECT count(*), max(bigm_similarity(col1, 'gin')) FROM test_bigm WHERE NOT col1 =% 'gin';
656  count |    max    
657 -------+-----------
658    244 | 0.0588235
659 (1 row)
660
661 SELECT count(*), min(bigm_similarity(col1, 'Tool')) FROM test_bigm WHERE col1 =% 'Tool';
662  count |    min    
663 -------+-----------
664      3 | 0.0645161
665 (1 row)
666
667 SELECT count(*), max(bigm_similarity(col1, 'Tool')) FROM test_bigm WHERE NOT col1 =% 'Tool';
668  count |    max    
669 -------+-----------
670    246 | 0.0555556
671 (1 row)
672
673 SELECT count(*), min(bigm_similarity(col1, 'performance')) FROM test_bigm WHERE col1 =% 'performance';
674  count | min  
675 -------+------
676    153 | 0.06
677 (1 row)
678
679 SELECT count(*), max(bigm_similarity(col1, 'performance')) FROM test_bigm WHERE NOT col1 =% 'performance';
680  count |    max    
681 -------+-----------
682     96 | 0.0588235
683 (1 row)
684
685 -- tests for drop of pg_bigm
686 DROP EXTENSION pg_bigm CASCADE;
687 NOTICE:  drop cascades to index test_bigm_idx
688 SELECT likequery('test');
689 ERROR:  function likequery(unknown) does not exist
690 LINE 1: SELECT likequery('test');
691                ^
692 HINT:  No function matches the given name and argument types. You might need to add explicit type casts.