On Fri, Nov 12, 2010 at 06:06:59PM +0200, Igor Zubkov wrote: > >> == šAddIndexOnChangelogtext: migrating ======================================== > >> -- add_index(:changelogs, :changelogtext) > > úÁÎÁÈÒÅÎÁ? > ÷ÏÔ ÞÔÏ ÂÙ ÔÁËÏÊ ÚÁÐÒÏÓ Ë âä ÒÁÂÏÔÁÌ ÂÙÓÔÒÏ, Á ÎÅ ËÁË ÓÅÊÞÁÓ... > ree-1.8.7-2010.02 > Changelog.where('changelogtext LIKE \'%CVE%\'').count > => 4288 > ree-1.8.7-2010.02 > "ûÁÒÉË, ÔÙ ÂÁÌÂÅÓ!" (Ã) http://www.postgresql.org/docs/9.0/interactive/indexes-types.html """The optimizer can also use a B-tree index for queries involving the pattern matching operators LIKE and ~ *if* the pattern is a constant and is anchored to the beginning of the string -- for example, col LIKE 'foo%' or col ~ '^foo', but not col LIKE '%bar'.""" -- Regards, -- Sir Raorn. --- http://thousandsofhate.blogspot.com/