Re: [GENERAL] full text search index

2016-05-26 Thread Kevin Grittner
You don't provide much context, like PostgreSQL version or machine characteristics. https://wiki.postgresql.org/wiki/SlowQueryQuestions On Wed, May 25, 2016 at 11:04 PM, Patrick Baker wrote: >> SELECT COUNT(DISTINCT j0_.id) AS sclr10 >> FROM customers j0_ >> WHERE ((LOWER(j0_.name_first) LIKE '

Re: [GENERAL] full text search index

2016-05-26 Thread Alban Hertroys
On 26 May 2016 at 06:04, Patrick Baker wrote: > Hi there, > > I've got the following query: >> >> >> SELECT COUNT(DISTINCT j0_.id) AS sclr10 >> FROM customers j0_ >> WHERE ((LOWER(j0_.name_first) LIKE '%some%' >> OR LOWER(j0_.name_last) LIKE '%some%') >>AND j0_.id = 5) >> AND j0_

Re: [GENERAL] full text search index

2016-05-26 Thread Patrick Baker
> > > > Maybe Lucas Possamai can help. He seems to be a little bit further along > in this exercise. > > I'm too tired to care at the moment. And I haven't had much practical > work here anyway. > > David J. > > > > I subscribed to the list today, so don't have the old emails I had a look o

[GENERAL] full text search index

2016-05-25 Thread David G. Johnston
On Thursday, May 26, 2016, Patrick Baker wrote: > Hi there, > > I've got the following query: > >> >> SELECT COUNT(DISTINCT j0_.id) AS sclr10 >> FROM customers j0_ >> WHERE ((LOWER(j0_.name_first) LIKE '%some%' >> OR LOWER(j0_.name_last) LIKE '%some%') >>AND j0_.id = 5) >> AND j

[GENERAL] full text search index

2016-05-25 Thread Patrick Baker
Hi there, I've got the following query: > > SELECT COUNT(DISTINCT j0_.id) AS sclr10 > FROM customers j0_ > WHERE ((LOWER(j0_.name_first) LIKE '%some%' > OR LOWER(j0_.name_last) LIKE '%some%') >AND j0_.id = 5) > AND j0_.id = 5 The query is taking ages to run. I read about wild