Re: [PERFORM] tsearch2, large data and indexes

2014-04-24 Thread Heikki Linnakangas
On 04/24/2014 10:57 PM, Sergey Konoplev wrote: On Thu, Apr 24, 2014 at 5:34 AM, Ivan Voras wrote: On 24 April 2014 13:34, Heikki Linnakangas wrote: As the docs say, the GIN index does not store the weights. As such, there is no need to strip them. A recheck would be necessary if your query n

Re: [PERFORM] Poor performance for delete query

2014-04-24 Thread Jonatan Evald Buus
On 24 April 2014 23:25, Tom Lane wrote: > Jonatan Evald Buus writes: > > On 24 April 2014 22:29, Tom Lane wrote: > >> I'd really have to bet that you forgot to index one of the referencing > >> tables. > > > *That was our first thought, so we went through the child tables to check > > but appar

Re: [PERFORM] Poor performance for delete query

2014-04-24 Thread Tom Lane
Jonatan Evald Buus writes: > On 24 April 2014 22:29, Tom Lane wrote: >> I'd really have to bet that you forgot to index one of the referencing >> tables. > *That was our first thought, so we went through the child tables to check > but apparently we missed some. (please see below for the differe

Re: [PERFORM] Poor performance for delete query

2014-04-24 Thread Jonatan Evald Buus
Many thanks for the swift reply Tom, please see additional input below /Jona On 24 April 2014 22:29, Tom Lane wrote: > Jonatan Evald Buus writes: > > We're currently having very poor performance for the following delete > query. > > DELETE FROM TopTable WHERE id IN (xx, yy, zz); > > > We've o

Re: [PERFORM] Poor performance for delete query

2014-04-24 Thread Tom Lane
Jonatan Evald Buus writes: > We're currently having very poor performance for the following delete query. > DELETE FROM TopTable WHERE id IN (xx, yy, zz); > We've observed that it takes around 7 seconds under normal load to for each > row that's being from TopTable and several minutes pr deleted

Re: [PERFORM] tsearch2, large data and indexes

2014-04-24 Thread Sergey Konoplev
On Thu, Apr 24, 2014 at 5:34 AM, Ivan Voras wrote: > On 24 April 2014 13:34, Heikki Linnakangas wrote: > >> As the docs say, the GIN index does not store the weights. As such, there is >> no need to strip them. A recheck would be necessary if your query needs the >> weights, precisely because the

[PERFORM] Poor performance for delete query

2014-04-24 Thread Jonatan Evald Buus
Greetings, We're currently having very poor performance for the following delete query. DELETE FROM TopTable WHERE id IN (xx, yy, zz); We've observed that it takes around 7 seconds under normal load to for each row that's being from TopTable and several minutes pr deleted row under heavy load. "i

Re: [PERFORM] tsearch2, large data and indexes

2014-04-24 Thread Sergey Konoplev
On Thu, Apr 24, 2014 at 4:34 AM, Heikki Linnakangas wrote: > On 04/24/2014 01:56 AM, Sergey Konoplev wrote: >> My guess is that you could use strip() function [1] to get rid of >> weights in your table or, that would probably be better, in your index >> only by using expressions in it and in the q

Re: [PERFORM] tsearch2, large data and indexes

2014-04-24 Thread Ivan Voras
On 24 April 2014 13:34, Heikki Linnakangas wrote: > As the docs say, the GIN index does not store the weights. As such, there is > no need to strip them. A recheck would be necessary if your query needs the > weights, precisely because the weights are not included in the index. > > (In the OP's q

Re: [PERFORM] tsearch2, large data and indexes

2014-04-24 Thread Heikki Linnakangas
On 04/24/2014 01:56 AM, Sergey Konoplev wrote: On Wed, Apr 23, 2014 at 4:08 AM, Ivan Voras wrote: Ok, I found out what is happening, quoting from the documentation: "GIN indexes are not lossy for standard queries, but their performance depends logarithmically on the number of unique words. (Ho