Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit572a9ab

Browse files
committed
Updated readme [skip ci]
1 parent00492d7 commit572a9ab

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎README.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,14 +485,16 @@ WITH relaxed_results AS MATERIALIZED (
485485
)SELECT*FROM relaxed_resultsORDER BY distance;
486486
```
487487

488-
For queries that filter by distance, use a materialized CTE and place the filter outside of it for best performance (due to the[current behavior](https://www.postgresql.org/message-id/flat/CAOdR5yGUoMQ6j7M5hNUXrySzaqZVGf_Ne%2B8fwZMRKTFxU1nbJg%40mail.gmail.com) of the Postgres executor)
488+
For queries that filter by distance, use a materialized CTE and place thedistancefilter outside of it for best performance (due to the[current behavior](https://www.postgresql.org/message-id/flat/CAOdR5yGUoMQ6j7M5hNUXrySzaqZVGf_Ne%2B8fwZMRKTFxU1nbJg%40mail.gmail.com) of the Postgres executor)
489489

490490
```sql
491-
WITHfiltered_resultsAS MATERIALIZED (
492-
SELECT id, embedding<->'[1,2,3]'AS distanceFROM itemsWHERE category_id=123ORDER BY distanceLIMIT5
493-
)SELECT*FROMfiltered_resultsWHERE distance<0.1ORDER BY distance;
491+
WITHnearest_resultsAS MATERIALIZED (
492+
SELECT id, embedding<->'[1,2,3]'AS distanceFROM itemsORDER BY distanceLIMIT5
493+
)SELECT*FROMnearest_resultsWHERE distance<5ORDER BY distance;
494494
```
495495

496+
Note: Place any other filters inside the CTE
497+
496498
###Iterative Scan Options
497499

498500
Since scanning a large portion of an approximate index is expensive, there are options to control when a scan ends

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp