The question would be why you would use rownum? rownum pseudocolumn would only show you the order in which the query retrieves the rows but not the actual location of the row.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Here in dTable i need ROWNUM for running number (record_id) column of dTable, which is my primary key.
also dTable is partitioned by range using this record_id column.
To genrate this running number i am using ROWNUM into select query of sTable.
The correct way of generating a surrogate PK sequence number is by using a SEQUENCE object.
Described partitioning strategy is pretty unusual, in most cases tables get partitioned either by a range of dates or a range/list of codes of some sort -don't remember seeing too many cases of a table partitioned by a sequence range. I'm not saying it is wrong, just a little unusual.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Assuming the application is going to insert more rows in the affected table I would go with a SEQUENCE.
- Partitioning
Tables are partitioned for one of two reasons -if you get lucky both of them; a) to help improve performance during quering and, b) to help improve performance during purging.
Ask yourself if your partitioning strategy matches any one of these cases.
If your honest answers are: No/No then partitioning strategy has to be revised.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Bookmarks