Complex query optimization - Mailing list pgsql-general

From Yuriy Rusinov
Subject Complex query optimization
Date
Msg-id 1ac023f40802010636q34589b60vd0b8d0cb784606ea@mail.gmail.com
Whole thread Raw
List pgsql-general
Hello, Colleagues !

I have a table with geographical objects, every object has set of semantic values. Thus we have object-semantic relation one-to-many. Tables structure was

objects
id_object | id_semantic
1               2
1               3
1               4
...
n               n1
n               n2

semantics
id_semantic semantic_value
2                  1.6
3                  4.0
...
n1                'ppp'
...

I have to select objects without semantics from list or if this semantic is set then its has to be satisfy defined condition
e.g.
select id_object from (objects as o inner join semantics as s on (2 not in (select id_semantic from objects as os where os.id_object=o.id_object) ));
List of semantic conditions is not limited, therefore execution time will be arise. What kind of optimization may be applied, for tables and queries ?
Thanks a lot.

--
Best regards,
Sincerely yours,
Yuriy Rusinov

pgsql-general by date:

Previous
From: Colin Wetherbee
Date:
Subject: Re: arrays of floating point numbers / linear algebra operations into the DB
Next
From: Stefan Schwarzer
Date:
Subject: pg_restore fails for postgis data dump