All Forums Teradata Database on VMWare
jatan 2 posts Joined 04/16
12 Apr 2016
Check partition that a query is accessing.

Hi,
Is there any way to get information about the partition that is being accessed when a query is being fired on a VMWare Teradata. I got one table that  has the query text in DBQL for all the queries hit.
Any table that provides partition column directly or any way to find out from the query text?

Thanks
Jatan
 

dnoeth 4628 posts Joined 11/04
13 Apr 2016

Hi Jatan,
why do you need that information?
It's not available in DBQL, depending on the Select it might be a single partition or 200000, how to store it?
 
The Explain text found in QryLogExplainV will include the number of partitions accessed like "single partition", "4 partitions", "all partitions".
 
If it's a WHERE-condition based on equality you could pass it to the partitioning function found in dbc.PartitioningConstraintsV.ConstraintText (after removing the CHECK):

SELECT CURRENT_DATE AS LogDate,
RANGE_N(LogDate  BETWEEN DATE '2010-01-01' AND DATE '2030-12-31' EACH INTERVAL '1' DAY )

2016-04-13	2295

 

Dieter

You must sign in to leave a comment.