Skip to content

Add search parameters to EXPLAIN (SETTINGS) - #697

Open
ankane wants to merge 1 commit into
masterfrom
guc-explain
Open

Add search parameters to EXPLAIN (SETTINGS)#697
ankane wants to merge 1 commit into
masterfrom
guc-explain

Conversation

@ankane

@ankane ankane commented Oct 22, 2024

Copy link
Copy Markdown
Member

Wanted to get feedback on this, which adds search parameters with non-default values to EXPLAIN (SETTINGS).

EXPLAIN (SETTINGS) SELECT * FROM items ORDER BY embedding <-> '[3,1,2]' LIMIT 5;
                                       QUERY PLAN                                        
-----------------------------------------------------------------------------------------
 Limit  (cost=8.02..12.04 rows=2 width=48)
   ->  Index Scan using items_embedding_idx on items  (cost=8.02..12.04 rows=2 width=48)
         Order By: (embedding <-> '[3,1,2]'::vector)
 Settings: hnsw.iterative_search = 'relaxed_order'

This seems useful for debugging, but the downside is it'll appear for all queries, not just ones that consider an approximate index.

@jkatz

jkatz commented Oct 23, 2024

Copy link
Copy Markdown
Contributor

Awesome. I think even for the cases it doesn't use the index, it could be helpful to know the parameter setting, as that could ultimately involve tweaking the parameter / indexing strategy.

@sagitrs sagitrs left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants