【发布时间】:2018-06-18 11:12:03
【问题描述】:
我已努力优化以下查询,但无法将其缩短到两分钟以下 - 这是预期的吗?有什么办法可以加快速度。我已添加索引并尽可能使用WITH。
match (md:MarketingDetail {Status: 'Live'})
with md limit 10
match (md) -[:Has_Area]-> (a:Area)
with md, a
match (ss:SavedSearch) -[:Has_Area]->(a)
with md, ss match
(md) -[:Has_Trade] -> (st:SectorTrade) <-[:Has_Trade]- (ss)
where ((md.FreeholdTenure ='Freehold'
and ss.FreeholdTenure = 'true'
and (md.FreeholdSearchPrice >= ss.PriceFrom
or md.FreeholdSearchPrice is null)
and (md.FreeholdSearchPrice <= ss.PriceTo
or md.FreeholdSearchPrice is null))
or (md.LeaseholdTenure is not null
and ss.LeaseholdTenure = 'true'
and (md.LeaseholdSearchPrice >= ss.PriceFrom
or md.LeaseholdSearchPrice is null)
and (md.LeaseholdSearchPrice <= ss.PriceTo
or md.LeaseholdSearchPrice is null)))
return count(ss)
这是上述查询的简介 -
谢谢!
【问题讨论】:
-
您能分享您的 PROFILE 输出(展开所有框并分享屏幕截图)吗?第一个之后不需要 WITH 语句。
-
我已将 PROFILE 的结果添加到上述问题中 - 谢谢!