OSDN Git Service

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