Re: [GENERAL] Creation of tsearch2 index is very slow

From: Ron <rjpeace(at)earthlink(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,pgsql-performance(at)postgresql(dot)org
Subject: Re: [GENERAL] Creation of tsearch2 index is very slow
Date: 2006-01-20 22:29:46
Message-ID: 7.0.1.0.2.20060120172335.039f5e20@earthlink.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

At 05:16 PM 1/20/2006, Steinar H. Gunderson wrote:
>On Fri, Jan 20, 2006 at 04:50:17PM -0500, Tom Lane wrote:
> > I wonder if there is a way to improve on that.
>
>Ooh, the farthest pair problem (in an N-dimensional vector space, though).
>I'm pretty sure problems like this has been studied quite extensively in the
>literature, although perhaps not with the same norm. It's known under both
>"farthest pair" and "diameter", and probably others. I'm fairly sure it
>should be solvable in at least O(n log n).

If the N-dimensional space is Euclidean (any <x, x+1> is the same
distance apart in dimension x), then finding the farthest pair can be
done in at least O(n).

If you do not want the actual distance and can create the proper data
structures, particularly if you can update them incrementally as you
generate pairs, it is often possible to solve this problem in O(lg n) or O(1).

I'll do some grinding.
Ron

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-01-20 22:33:27 Re: [GENERAL] Creation of tsearch2 index is very slow
Previous Message Chris Browne 2006-01-20 22:23:59 Re: Page-Level Encryption

Browse pgsql-performance by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-01-20 22:33:27 Re: [GENERAL] Creation of tsearch2 index is very slow
Previous Message Steinar H. Gunderson 2006-01-20 22:16:55 Re: [GENERAL] Creation of tsearch2 index is very slow