Searching for appropriate pivots for my Fixed Query Array

From: "Janek Sendrowski" <janek12(at)web(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Searching for appropriate pivots for my Fixed Query Array
Date: 2013-11-01 19:06:55
Message-ID: trinity-18ca17b0-595d-4d06-87a8-9190f6f97da4-1383332815184@3capp-webde-bs18
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I am trying to build my database with a metric index. I am using a Fixed Query Array.
I have got a table with many sentences of natural languages. I'm using the Dice Coefficient for calculating the metric space.
I am going to take a certain number of sentences and use them as pivots by calculating their distance to all of my sentences.

The table of distances looks like this:

id INTEGER, pivot TEXT, distance1 REAL, distance2 REAL, distance3 REAL, ...  Eine Query sieht so aus:

A query looks like this:

SELECT id FROM distance 
WHERE dice('sentence', 'pivot1') BETWEEN (distance1 - radius) AND (distance1 + radius) 
  AND dice('sentence', 'pivot2') BETWEEN (distance2 - radius) AND (distance2 + radius) 
  AND dice('sentence', 'pivot3') BETWEEN (distance3 - radius) AND (distance3 + radius) 
  ...

My issue is to find appropriate pivots now.
I cannot take all existing words, that would be too much.

Does any of you have an idea?

TX very much for any support!

Janek

Browse pgsql-general by date

  From Date Subject
Next Message Ben Chobot 2013-11-01 20:44:12 9.1.9 -> 9.1.10 causing corruption
Previous Message Tom Lane 2013-11-01 18:50:27 Re: json datatype and table bloat?