1

my project doesn't appear to be using cached BigQuery tables for subsequent queries. I'm testing a simple:

SELECT
  count(column)
FROM
  table

in the console UI and each time it's still processing and billing.

I am using the streaming API (python 3.7) to add to this table but the last modified table time is over 30 minutes ago so the cache shouldn't be invalidated.

I'm also confirmed that "Use Cached Results" is toggled on.

Thanks in advance

Conlan
  • 11
  • 1
  • Hi Conlan, following the answer of vinoaj in your scenario cached query is not available. But if you must use cached query (budget issue), maybe you could follow the approach to create another table from the query result of *table* and update this new table periodically. Using Cloud Scheduler + Cloud Function you can code this solution. Following a link to help you: https://cloud.google.com/scheduler/docs/tut-pub-sub – hkanjih Feb 18 '19 at 08:44
  • Okay thanks hkanjih, I'll take a look at this. – Conlan Feb 18 '19 at 11:23

1 Answers1

1

Because you are using a streaming table, cached results are not considered. According to Google:

Query results are not cached: ... When any of the tables referenced by the query have recently received streaming inserts (a streaming buffer is attached to the table) even if no new rows have arrived

vinoaj
  • 1,600
  • 10
  • 8
  • Hi vinoaj, do you know how long this period is for tables that have "recently received streaming inserts"? This table was last modified over 30 minutes ago, is the period like 1 hour, 2 hours, etc. Thanks again for the reply – Conlan Feb 18 '19 at 04:11