Searching for appropriate pivots for my Fixed Query Array - Mailing list pgsql-general

From Janek Sendrowski
Subject Searching for appropriate pivots for my Fixed Query Array
Date
Msg-id trinity-18ca17b0-595d-4d06-87a8-9190f6f97da4-1383332815184@3capp-webde-bs18
Whole thread Raw
List 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


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: json datatype and table bloat?
Next
From: Ben Chobot
Date:
Subject: 9.1.9 -> 9.1.10 causing corruption