Re: [GENERAL] Prefix LIKE search and indexes issue.

2010-07-25 Thread Harald Fuchs
In article , Marcelo de Moraes Serpa writes: > Some good souls hinted me at the prefix extension, but > how would I use it? Like this: CREATE TABLE users ( id serial NOT NULL, name text NOT NULL, reversed_domain prefix_range NULL, PRIMARY KEY (id) ); CREATE INDEX users_dom_ix ON users

Re: [GENERAL] Prefix LIKE search and indexes issue.

2010-07-24 Thread Alban Hertroys
On 23 Jul 2010, at 23:22, Marcelo de Moraes Serpa wrote: > The following query works: > > SELECT * FROM users WHERE 'com.app.mycompany' LIKE reversed_domain || % > > However, it does sequential search, meaning it doesn't use any index. The database may choose to use a seqscan for several reason