pg.ddx.io  pgvector/pgvector GitHub issues and pull requests  
help / color / mirror / Atom feed
[pgvector/pgvector] issue #167: Set ivfflat.probes
10+ messages / 5 participants
[nested] [flat]

* [pgvector/pgvector] issue #167: Set ivfflat.probes
@ 2023-06-21 02:30 "edgarbrignoni (@edgarbrignoni)" <noreply+edgarbrignoni@github.com>
  0 siblings, 0 replies; 10+ messages in thread

From: edgarbrignoni (@edgarbrignoni) @ 2023-06-21 02:30 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

Is there's a way `ivfflat.probes` can be set permanently?

Kind Regards,

Edgar B.

^ permalink  raw  [nested|flat] 10+ messages in thread

* Re: [pgvector/pgvector] issue #167: Set ivfflat.probes
@ 2023-06-21 02:31 ` "edgarbrignoni (@edgarbrignoni)" <noreply+edgarbrignoni@github.com>
  8 siblings, 0 replies; 10+ messages in thread

From: edgarbrignoni (@edgarbrignoni) @ 2023-06-21 02:31 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

@edgarbrignoni renamed this.

^ permalink  raw  [nested|flat] 10+ messages in thread

* Re: [pgvector/pgvector] issue #167: Set ivfflat.probes
@ 2023-06-21 02:58 ` "jkatz (@jkatz)" <noreply+jkatz@github.com>
  8 siblings, 0 replies; 10+ messages in thread

From: jkatz (@jkatz) @ 2023-06-21 02:58 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

You can set the value permanently in the postgresql.conf file or via `ALTER SYSTEM`.

^ permalink  raw  [nested|flat] 10+ messages in thread

* Re: [pgvector/pgvector] issue #167: Set ivfflat.probes
@ 2023-06-21 13:31 ` "ankane (@ankane)" <noreply+ankane@github.com>
  8 siblings, 0 replies; 10+ messages in thread

From: ankane (@ankane) @ 2023-06-21 13:31 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

@ankane closed this.

^ permalink  raw  [nested|flat] 10+ messages in thread

* Re: [pgvector/pgvector] issue #167: Set ivfflat.probes
@ 2023-06-21 13:31 ` "ankane (@ankane)" <noreply+ankane@github.com>
  8 siblings, 0 replies; 10+ messages in thread

From: ankane (@ankane) @ 2023-06-21 13:31 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

Hi @edgarbrignoni, you can also set it on the database or user:

```sql
ALTER DATABASE mydb SET ivfflat.probes = 10;
```

or

```sql
ALTER USER myuser SET ivfflat.probes = 10;
```

(then reconnect for it to take effect)

^ permalink  raw  [nested|flat] 10+ messages in thread

* Re: [pgvector/pgvector] issue #167: Set ivfflat.probes
@ 2023-06-22 16:09 ` "edgarbrignoni (@edgarbrignoni)" <noreply+edgarbrignoni@github.com>
  8 siblings, 0 replies; 10+ messages in thread

From: edgarbrignoni (@edgarbrignoni) @ 2023-06-22 16:09 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

Thank you for the feedback! I will try those settings.

^ permalink  raw  [nested|flat] 10+ messages in thread

* Re: [pgvector/pgvector] issue #167: Set ivfflat.probes
@ 2023-10-26 01:15 ` "ankitml (@ankitml)" <noreply+ankitml@github.com>
  8 siblings, 0 replies; 10+ messages in thread

From: ankitml (@ankitml) @ 2023-10-26 01:15 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

Hey Folks, Setting this param works. However checking its value has been elusive. 
Neither of these two approaches show this setting on the database. 
* SHOW ivfflat.probes
* SELECT name, setting
FROM pg_settings where name LIKE '%prob%'; 


^ permalink  raw  [nested|flat] 10+ messages in thread

* Re: [pgvector/pgvector] issue #167: Set ivfflat.probes
@ 2023-10-26 03:55 ` "ankane (@ankane)" <noreply+ankane@github.com>
  8 siblings, 0 replies; 10+ messages in thread

From: ankane (@ankane) @ 2023-10-26 03:55 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

It shows up with `SHOW ivfflat.probes;` when set on the database (be sure to reconnect after changing as mentioned above). Also, it's a regular Postgres config variable, so any behavior isn't specific to pgvector.

^ permalink  raw  [nested|flat] 10+ messages in thread

* Re: [pgvector/pgvector] issue #167: Set ivfflat.probes
@ 2023-10-26 15:41 ` "ankitml (@ankitml)" <noreply+ankitml@github.com>
  8 siblings, 0 replies; 10+ messages in thread

From: ankitml (@ankitml) @ 2023-10-26 15:41 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

Thanks, I was missing the reconnect :) 

^ permalink  raw  [nested|flat] 10+ messages in thread

* Re: [pgvector/pgvector] issue #167: Set ivfflat.probes
@ 2025-09-25 15:13 ` "xak2000 (@xak2000)" <noreply+xak2000@github.com>
  8 siblings, 0 replies; 10+ messages in thread

From: xak2000 (@xak2000) @ 2025-09-25 15:13 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

I encountered similar problem:

```
SHOW hnsw.ef_search;
```

Resulted in:

```
SQL Error [42704]: ERROR: unrecognized configuration parameter "hnsw.ef_search"
```

And

```
SELECT * FROM pg_settings WHERE name LIKE '%hnsw%';
```

Resulted in empty result.

I experimented a little and both queries are starting to work after I do in the current session any action, that initializes `pgvector` extension. E.g. It could be `CREATE TABLE` with a `vector` column. Or a `SELECT` from such table using any distance-calculating function in the query (e.g. `SELECT *, embedding <=> '[1]' AS distance FROM vector_store;`).

If I re-connect to the DB after this, the `SHOW hnsw.ef_search;` command starts to return an "unrecognized configuration parameter" error again.

So, it looks like the `pgvector` extension does not initialize automatically until something that "touches" it happens.
That is the reason why sometimes `SHOW` and `SELECT .. FROM pg_settings` works, while sometimes it does not work.

@ankane 
> Also, it's a regular Postgres config variable, so any behavior isn't specific to pgvector.

So, I would say, while it is a regular config variable, the behavior is still not exactly standard/expected. With all regular Postgres config variables you can always run `SHOW` to get the current value of this variable, while with `pgvector` variables the ability to successfully do this depends on sneaky conditions.

^ permalink  raw  [nested|flat] 10+ messages in thread


end of thread, other threads:[~2025-09-25 15:13 UTC | newest]

Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-06-21 02:30 [pgvector/pgvector] issue #167: Set ivfflat.probes "edgarbrignoni (@edgarbrignoni)" <noreply+edgarbrignoni@github.com>
2023-06-21 02:31 ` "edgarbrignoni (@edgarbrignoni)" <noreply+edgarbrignoni@github.com>
2023-06-21 02:58 ` "jkatz (@jkatz)" <noreply+jkatz@github.com>
2023-06-21 13:31 ` "ankane (@ankane)" <noreply+ankane@github.com>
2023-06-21 13:31 ` "ankane (@ankane)" <noreply+ankane@github.com>
2023-06-22 16:09 ` "edgarbrignoni (@edgarbrignoni)" <noreply+edgarbrignoni@github.com>
2023-10-26 01:15 ` "ankitml (@ankitml)" <noreply+ankitml@github.com>
2023-10-26 03:55 ` "ankane (@ankane)" <noreply+ankane@github.com>
2023-10-26 15:41 ` "ankitml (@ankitml)" <noreply+ankitml@github.com>
2025-09-25 15:13 ` "xak2000 (@xak2000)" <noreply+xak2000@github.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox