LastAccess Time stamp not getting updated for table

Database

LastAccess Time stamp not getting updated for table

I have come across a strange situation. I have a view which points to a Global temporary table. There is a daily process that runs a macro to insert data into the view and then use it for select query Joins.

The problem here is, if i check the Lastaccesstimestamp from dbc.tables, it shows time correct time for View(time at which the process had run) but the lastaccesstimestamp is not updated for the table. It shows some days difference.

I checked similar views and tables used by the same macro and all those views and corresponding tables have matching lastaccesstime.

The only difference i saw between these views is the creator name. Will this cause the difference in lastaccesstime? if not what else can be causing the problem.

4 REPLIES
Enthusiast

Re: LastAccess Time stamp not getting updated for table

If your in 14.10 and above, verify DBQL ObjectUsage is enabled for given View Database in DBC.DBQLRules.

If not, enabled USECOUNT for the database:

BEGIN QUERY LOGGING WITH USECOUNT on <<database>>;

Also be informed, END QUERY LOGGING request does not write object Use count cache to disk but spoil the

collected counts. As a result, the collect counts may be lost.

The solution, is to wait until the ObjectUseCountCollectRate time has elapsed as it performs a scheduled flush.

Thanks!!

Teradata Employee

Re: LastAccess Time stamp not getting updated for table

The query does not access the Global Temporary Table itself, but rather a "materialized instance" of the Global Temporary table which is unique to the session and dropped when that session terminates.  

Re: LastAccess Time stamp not getting updated for table

But when I run a select query directly on the view, with my user id, the timestamp of the table also get updated

Enthusiast

Re: LastAccess Time stamp not getting updated for table

I think we are seeing this too... inserts to a global temp table thru a macro were not updating lastaccesstimestamp the table's dictionary entry.  Perhaps Fred's comment applies here.



Presuming the global temp table was dormant, we dropped the global temp table only to find out a monthly job was populating it.



We are on 14.00