refactor: duplicate queries (#19136)

This commit is contained in:
Jason Rasmussen
2025-06-12 14:23:02 -04:00
committed by GitHub
parent 144cc8ab6d
commit 5cd186d3d4
14 changed files with 280 additions and 270 deletions

View File

@@ -102,39 +102,6 @@ offset
$8
commit
-- SearchRepository.searchDuplicates
begin
set
local vchordrq.probes = 1
with
"cte" as (
select
"assets"."id" as "assetId",
"assets"."duplicateId",
smart_search.embedding <=> $1 as "distance"
from
"assets"
inner join "smart_search" on "assets"."id" = "smart_search"."assetId"
where
"assets"."visibility" in ('archive', 'timeline')
and "assets"."ownerId" = any ($2::uuid[])
and "assets"."deletedAt" is null
and "assets"."type" = $3
and "assets"."id" != $4::uuid
and "assets"."stackId" is null
order by
"distance"
limit
$5
)
select
*
from
"cte"
where
"cte"."distance" <= $6
commit
-- SearchRepository.searchFaces
begin
set