You are correct: Phoenix supports attaching properties like session ID, user ID, tags, and metadata to spans using context managers or helpers (e.g., `using_session`, `using_user`, `using_metadata`, `using_tags`) as described in the <https://arize.com/docs/phoenix/sdk-api-reference/python/arize-phoenix-otel#manual-instrumentation-helpers|manual instrumentation helpers documentation>. Filtering by session ID is already optimized, but filtering by user ID, tags, and metadata may not be as performant, especially for large datasets, since these are often stored as generic attributes or JSON fields rather than indexed columns, leading to slower queries in the UI or backend.
Recent Phoenix releases have improved attribute-based filtering, allowing you to filter spans by attribute values (including user ID, tags, and metadata) using the Python, TypeScript, REST, and CLI interfaces, with type-aware matching and AND semantics (<https://arize.com/docs/phoenix/release-notes/04-2026/04-20-2026-span-attribute-filter-cli-notes-and-opus-4-7|span attribute filtering docs>). However, the underlying database performance for these filters depends on how the attributes are stored and indexed. Session ID is typically indexed for performance, but user ID, tags, and metadata may not be, which can result in slower queries as you observed.
Would you like more detail on how to optimize filtering or on the current implementation of attribute storage and querying in Phoenix?
Sources:
- <https://arize.com/docs/phoenix/release-notes/04-2026/04-20-2026-span-attribute-filter-cli-notes-and-opus-4-7|Span Attribute Filtering, CLI Notes, and Claude Opus 4.7>
- <https://arize.com/docs/phoenix/sdk-api-reference/python/arize-phoenix-otel#manual-instrumentation-helpers|manual instrumentation helpers documentation>