We have a sql table in SQL Server (Azure SQL) with the following format
[id] [int] IDENTITY(1,1) NOT NULL
[STRINGID] [varchar](30) NOT NULL
... many data columns
The clustered index is on the id column, the primary key is on the STRINGID column. The STRINGID column is externally generated and always follows this format "{external_id_string}-{YYYYMMDDHHMMSS}". The row data is produced "live" so the timestamp from the external_id_string and the numeric id value are strongly correlated.
The table queries are almost always filtered by STRINGID. However, due to the number of rows, queries tend to become slow and if we look at the execution plan and performance metrics it is always due to data IO. The size of the PK index is ~10GB.
We were thinking if we would profit from table partitioning? We could add a persisted computed column which holds the timestamp from the STRINGID column and partition on that value by month.
However, i am not sure and did not find any information if the query optimizer would be able to perform partition elimination if we still filter only on STRINGID or if all queries would need to filter on both STRINGID and COMPUTED_COLUMN_TIMESTAMP?
Thank you!