All Forums Database
sreenu.rnn 2 posts Joined 05/12
05 May 2015
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.

TDThrottle 51 posts Joined 11/11
05 May 2015

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:



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.




Fred 1096 posts Joined 08/04
06 May 2015

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.  

sreenu.rnn 2 posts Joined 05/12
06 May 2015

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

dnarva 7 posts Joined 03/10
27 May 2015

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

You must sign in to leave a comment.