Advanced visibility using database

Is it possible to use the Advanced Visibility feature using just the database? If that is possible, I would prefer this option instead of relying on Elasticsearch. The reason is that Elasticsearch consumes a lot of memory.

If it’s possible, how to configure Temporal to use Advanced Visibility with PostgreSQL?

This feature was just added in the 1.20 release of the service.

1 Like

Thank you, maxim. This feature is very nice, it will allow using Advanced Visibility without adding Elasticsearch to the stack. This is good for small deployments. For large deployments that already have Elasticsearch in the stack or have a large number of search requirements, it makes sense to use Advanced Visibility with ES.

Do we need to set some env vars to enable this? We’re on the latest version but not able to use the advanced visibility features.

The docs just say

  • With Temporal Cluster version 1.20 and later, Advanced Visibility is available on SQL databases like MySQL (version 8.0.17 and later) and PostgreSQL (version 12 and later), in addition to supporting Elasticsearch.

with no info on how to actually enable it? or should it just work automatically?

Looks like the auto setup script uses this var -

Is this all thats needed? Trying to configure it all via env vars if possible.


Release notes for 1.20 release have some details, working on sample for it as well.

“Change the sql.pluginName config to mysql8 or postgres12 accordingly.”

For docker compose that would be the “DB” env var value.

Thanks, do we also need to set VISIBILITY_DBNAME=temporal_visibility on the services?

(Is there a good tctl command to check its working?)

Yes that should be same imo.

For tctl you could run tctl wf l -q "your query"
where you use in query more than one argument, for example "ExecutionStatus='Running' AND WorkflowType='abc'". Specifying multiple args does not work with standard vis.

Is there an env var for setting the plugin name?

Currently we just have "DB" = "postgresql"