Icarus
Icarus

Reputation: 1463

BigQuery Table Last Query Date

I heavily use bigQuery and there are now quite a number of intermediate tables. Because teammates can upload their own tables, I do not understand all the tables well.

I want to check if a table have not been used for a long time, then check if it can be deleted manually.

Is there anyone know how to do?

Many thanks

Upvotes: 0

Views: 2048

Answers (2)

Inam Imthiyaz
Inam Imthiyaz

Reputation: 39

You can get table specific meta data via the TABLES command.

SELECT *,TIMESTAMP_MILLIS(LAST_MODIFIED_TIME) ACCESS_DATE
FROM [DATASET].__TABLES__

The mentioned code snippet should provide you with the last access date.

Upvotes: -1

Martin Weitzmann
Martin Weitzmann

Reputation: 4736

You could use logs if you have access. If you made yourself familiar with how to filter log entries you can find out about your usage quite easily: https://cloud.google.com/logging/docs/quickstart-sdk#explore

There's also the possibility of exporting logs to big query - so you could analyze them using SQL - I guess that's even more convenient.

Upvotes: 3

Related Questions