Skip to content

rocpdsna: schema 4.0.0 — use inline BIGINT timestamps instead of rocpd_timestamp FK table#5994

Closed
avansick-amd wants to merge 1 commit into
ROCm:users/anujshuk-amd/versioned-rocpd-sna-develop_with_v4from
avansick-amd:users/avansick-amd/rocpd-schema-v40-timestamp-fix
Closed

rocpdsna: schema 4.0.0 — use inline BIGINT timestamps instead of rocpd_timestamp FK table#5994
avansick-amd wants to merge 1 commit into
ROCm:users/anujshuk-amd/versioned-rocpd-sna-develop_with_v4from
avansick-amd:users/avansick-amd/rocpd-schema-v40-timestamp-fix

Conversation

@avansick-amd

Copy link
Copy Markdown

Summary

This PR modifies the schema 4.0.0 SQL files and schema_v4 C++ writers in PR #5347 to use
inline BIGINT timestamps (start, end) instead of FK references to a separate
rocpd_timestamp table.

Changes

SQL schema (schema/4.0.0/)

  • rocpd_tables.sql — removed rocpd_timestamp table; replaced start_id/end_id INTEGER FK
    columns with start/end BIGINT on rocpd_region, rocpd_kernel_dispatch,
    rocpd_memory_copy, rocpd_memory_allocate; replaced timestamp_id FK with timestamp
    BIGINT on rocpd_sample; removed FK constraints referencing rocpd_timestamp
  • rocpd_indexes.sql — removed two indexes on rocpd_timestamp
    (rocpd_timestamp_value_idx, rocpd_timestamp_guid_value_idx)
  • data_views.sql — removed all rocpd_timestamp JOINs from regions, kernels,
    memory_copies, memory_allocations, samples views; reads start/end/timestamp
    directly from inline columns

C++ writers (source/)

  • insert_statements.hpp — removed timestamp INSERT; updated INSERT statements to bind
    start/end/timestamp BIGINT directly
  • writers/schema_v4/common_insert_operations.hpp — removed insert_timestamp() helper
  • writers/schema_v4/region_writer.hpp — direct BIGINT bind for start/end
  • writers/schema_v4/kernel_dispatch_writer.hpp — direct BIGINT bind for start/end
  • writers/schema_v4/memory_copy_writer.hpp — direct BIGINT bind for start/end
  • writers/schema_v4/memory_alloc_writer.hpp — direct BIGINT bind for start/end

Motivation

The rocpd_timestamp FK indirection adds write overhead (two inserts per event instead of one)
and complicates reads (every view requires a JOIN). Storing timestamps inline as BIGINT is
simpler, faster, and consistent with how other integer fields are handled in the schema.

Test results

358 tests pass. 183 pre-existing failures (unrelated rocpd_info_node column bug in PR #5347
base) are unchanged — zero new failures introduced.

…d_timestamp FK table

Replace the two-step FK mechanism (rocpd_timestamp table + start_id/end_id FK columns)
with inline BIGINT start/end columns on all five fact tables:
- rocpd_region: start_id/end_id INTEGER FK -> "start"/"end" BIGINT
- rocpd_sample: timestamp_id INTEGER FK -> "timestamp" BIGINT
- rocpd_kernel_dispatch: start_id/end_id INTEGER FK -> "start"/"end" BIGINT
- rocpd_memory_copy: start_id/end_id INTEGER FK -> "start"/"end" BIGINT
- rocpd_memory_allocate: start_id/end_id INTEGER FK -> "start"/"end" BIGINT

Remove the rocpd_timestamp table and its two indexes from the schema.
Update data_views.sql to remove all rocpd_timestamp JOINs, reading inline columns directly.
Update schema_v4 C++ insert_statements.hpp and all five writer headers to match.
@avansick-amd avansick-amd force-pushed the users/avansick-amd/rocpd-schema-v40-timestamp-fix branch from 70630ee to 051b10d Compare May 12, 2026 13:08
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

This pull request has been inactive for 25 days and will be marked as stale.

If you would like to keep this PR open, please:

  • Add new commits
  • Add a comment explaining why it should remain open

This PR will be automatically closed in 5 days if no further activity occurs.

@github-actions github-actions Bot added the Stale PR has no activity for 25+ days label Jun 7, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed due to inactivity (30 days with no updates).

If you'd like to continue working on this, feel free to reopen the PR or create a new one.

@github-actions github-actions Bot closed this Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

organization: ROCm Stale PR has no activity for 25+ days

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant