I’m having trouble to find all possible ways to call specific partitions of a partitioned table, in Teradata.
I need to find eventual usage of partition calling in Teradata files, and I need to cover every case to be sure it is or not used.
I know things like
SELECT *, PARTITION
FROM my_table
WHERE PARTITION = 3;
can exist, but I don’t know if that is the only possibility.
I’m looking for resources or a list of usage cases.
Thanks!
Can you try to explain a bit more clearly what you are trying to do?
One does not normally reference a partition explicitly. If the table has partitioning the optimizer will decide whether or not to leverage that in the query plan and which partitions will be accessed. If you have DBQL FEATUREINFO logging active you may be able to use the FeatureUsage bit-flags to determine when the optimizer cared about data being partitioned – but not which partitions.
@Andrew I’m trying to convert Teradata tables into BigQuery. However, BigQuery partitioning is more limited than Teradata. If the partitioning is only used for optimization, that will be fine, but if the partitions are called explicitly inside things like macros etc., this might create some issues, so I need to be exhaustive to find any possible occurrence of partition calling.