以下是查询movie_master.displayordermovie_itemdetails.fieldid = 1 and movie_itemdetails.Type ='TRAILER'
and ((MOVIE_VERSION.FilmCode in (SELECT DISTINCTFILMID FROM MOVIE_TEMP)) OR (MOVIE_VERSION.Title in (
但是,我发现它返回的是重复的行,所以我向查询添加了select distinct,这解决了重复问题,但存在严重的性能问题。我的理解是,在这种情况下,select distinct on (records.id), id...将返回相同的结果,因为所有重复项都将具有相同的主键,并且似乎快了大约两倍。下面是我的问题: FROM records
INNER JOIN records parents on parents.path @> records.path