| 1 |
DROP INDEX trgm_idx2; |
| 2 |
|
| 3 |
\copy test_trgm3 from 'data/trgm2.data' |
| 4 |
|
| 5 |
-- reduce noise |
| 6 |
set extra_float_digits = 0; |
| 7 |
|
| 8 |
select t,strict_word_similarity('Baykal',t) as sml from test_trgm2 where 'Baykal' <<% t order by sml desc, t; |
| 9 |
select t,strict_word_similarity('Kabankala',t) as sml from test_trgm2 where 'Kabankala' <<% t order by sml desc, t; |
| 10 |
select t,strict_word_similarity('Baykal',t) as sml from test_trgm2 where t %>> 'Baykal' order by sml desc, t; |
| 11 |
select t,strict_word_similarity('Kabankala',t) as sml from test_trgm2 where t %>> 'Kabankala' order by sml desc, t; |
| 12 |
select t <->>> 'Alaikallupoddakulam', t from test_trgm2 order by t <->>> 'Alaikallupoddakulam' limit 7; |
| 13 |
|
| 14 |
create index trgm_idx2 on test_trgm2 using gist (t gist_trgm_ops); |
| 15 |
set enable_seqscan=off; |
| 16 |
|
| 17 |
select t,strict_word_similarity('Baykal',t) as sml from test_trgm2 where 'Baykal' <<% t order by sml desc, t; |
| 18 |
select t,strict_word_similarity('Kabankala',t) as sml from test_trgm2 where 'Kabankala' <<% t order by sml desc, t; |
| 19 |
select t,strict_word_similarity('Baykal',t) as sml from test_trgm2 where t %>> 'Baykal' order by sml desc, t; |
| 20 |
select t,strict_word_similarity('Kabankala',t) as sml from test_trgm2 where t %>> 'Kabankala' order by sml desc, t; |
| 21 |
|
| 22 |
explain (costs off) |
| 23 |
select t <->>> 'Alaikallupoddakulam', t from test_trgm2 order by t <->>> 'Alaikallupoddakulam' limit 7; |
| 24 |
select t <->>> 'Alaikallupoddakulam', t from test_trgm2 order by t <->>> 'Alaikallupoddakulam' limit 7; |
| 25 |
|
| 26 |
drop index trgm_idx2; |
| 27 |
create index trgm_idx2 on test_trgm2 using gin (t gin_trgm_ops); |
| 28 |
set enable_seqscan=off; |
| 29 |
|
| 30 |
select t,strict_word_similarity('Baykal',t) as sml from test_trgm2 where 'Baykal' <<% t order by sml desc, t; |
| 31 |
select t,strict_word_similarity('Kabankala',t) as sml from test_trgm2 where 'Kabankala' <<% t order by sml desc, t; |
| 32 |
select t,strict_word_similarity('Baykal',t) as sml from test_trgm2 where t %>> 'Baykal' order by sml desc, t; |
| 33 |
select t,strict_word_similarity('Kabankala',t) as sml from test_trgm2 where t %>> 'Kabankala' order by sml desc, t; |
| 34 |
|
| 35 |
set "pg_trgm.strict_word_similarity_threshold" to 0.4; |
| 36 |
select t,strict_word_similarity('Baykal',t) as sml from test_trgm2 where 'Baykal' <<% t order by sml desc, t; |
| 37 |
select t,strict_word_similarity('Kabankala',t) as sml from test_trgm2 where 'Kabankala' <<% t order by sml desc, t; |
| 38 |
select t,strict_word_similarity('Baykal',t) as sml from test_trgm2 where t %>> 'Baykal' order by sml desc, t; |
| 39 |
select t,strict_word_similarity('Kabankala',t) as sml from test_trgm2 where t %>> 'Kabankala' order by sml desc, t; |
| 40 |
|
| 41 |
set "pg_trgm.strict_word_similarity_threshold" to 0.2; |
| 42 |
select t,strict_word_similarity('Baykal',t) as sml from test_trgm2 where 'Baykal' <<% t order by sml desc, t; |
| 43 |
select t,strict_word_similarity('Kabankala',t) as sml from test_trgm2 where 'Kabankala' <<% t order by sml desc, t; |
| 44 |
select t,strict_word_similarity('Baykal',t) as sml from test_trgm2 where t %>> 'Baykal' order by sml desc, t; |
| 45 |
select t,strict_word_similarity('Kabankala',t) as sml from test_trgm2 where t %>> 'Kabankala' order by sml desc, t; |