Skip to content

Conversation

@kirkw
Copy link

@kirkw kirkw commented Jan 11, 2026

This PR adds comprehensive documentation for the LAST_QUERY_MS variable feature and updates the \timing command documentation.

Changes

1. Updated \timing command documentation

  • Added clarification that query execution time is always measured regardless of the \timing setting
  • Documented that \timing only controls display, not measurement
  • Added cross-reference to LAST_QUERY_MS variable

2. Added LAST_QUERY_MS variable documentation

  • New section documenting the LAST_QUERY_MS variable
  • Explains it contains execution time in milliseconds (3 decimal places)
  • States it's always updated after each query execution
  • Notes initialization to 0 at session start
  • Includes usage example for conditional logic

Files Changed

  • doc/src/sgml/ref/psql-ref.sgml: Updated \timing section and added LAST_QUERY_MS variable documentation (+38 lines)

Related

This completes the documentation for the feature implemented in commit 735349f21a6 ("psql: Always measure query timing, store in LAST_QUERY_MS variable").

Update the \timing command documentation to clarify that:
- Query execution time is always measured regardless of \timing setting
- \timing only controls whether timing information is displayed
- The measured time is always available in LAST_QUERY_MS variable

Add comprehensive documentation for the LAST_QUERY_MS variable:
- Explains it contains execution time in milliseconds (3 decimal places)
- Always updated after each query execution
- Initialized to 0 at session start
- Includes usage example for conditional logic

This completes the documentation for the LAST_QUERY_MS feature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants