Re: LIKE pattern - Mailing list pgsql-performance

From SoDupuDupu
Subject Re: LIKE pattern
Date
Msg-id 1462830066860-5902701.post@n5.nabble.com
Whole thread Raw
In response to LIKE pattern  (Владимир <vovka@krevedko.su>)
Responses Re: LIKE pattern  (Robert Klemme <shortcutter@googlemail.com>)
List pgsql-performance
Владимир-3 wrote
> It seems my quite complex query runs 10 times faster on "some_column
> LIKE '%test_1' " vs "some_column LIKE 'test_1' "
> So I just add "%"  to the pattern...

Keep in mind then LIKE '%test_1' and LIKE 'test_1' are not equivalent, using
the % as a prefix to the argument means that the scan only has to confirm
that the value ends in 'test_1' where forgoing the % entirely means that you
are essentially saying some_column='test_1'.




--
View this message in context: http://postgresql.nabble.com/LIKE-pattern-tp5902225p5902701.html
Sent from the PostgreSQL - performance mailing list archive at Nabble.com.


pgsql-performance by date:

Previous
From: Владимир
Date:
Subject: LIKE pattern
Next
From: Robert Klemme
Date:
Subject: Re: LIKE pattern