Advertisement
Guest User

Untitled

a guest
Jan 27th, 2013
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     postgres=# create database test3;
  2.     CREATE DATABASE
  3.    
  4.     bbazar=# \connect test3;
  5.     SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
  6.     You are now connected to database "test3" as user "postgres".
  7.    
  8.     test3=# create table test (id bigserial, title character varying);
  9.     NOTICE:  CREATE TABLE will create implicit sequence "test_id_seq" for serial column "test.id"
  10.     CREATE TABLE
  11.    
  12.     test3=# insert into test (title) values ('Testing text');
  13.     INSERT 0 1
  14.    
  15.     test3=# create extension pg_trgm;
  16.     CREATE EXTENSION
  17.    
  18.     test3=# create index on test using gin (title gin_trgm_ops);
  19.     CREATE INDEX
  20.    
  21.     test3=# explain select * from test where title like '%tin%';
  22.                          QUERY PLAN                      
  23.     -----------------------------------------------------
  24.      Seq Scan on test  (cost=0.00..1.01 rows=1 width=40)
  25.        Filter: ((title)::text ~~ '%tin%'::text)
  26.     (2 rows)
  27.    
  28.     test3=#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement