Database Reference
In-Depth Information
| index | millis |
+-------+---------------+
| 8 | 1395214790355 |
| 9 | 1395214802060 |
| 7 | 1395214778642 |
| 10 | 1395214814200 |
+-------+---------------+
Finally, here is how you would reference a closed interval:
$ AROUND_3=$((${START_TIME} + 3 * 10 * 1000))
$ AROUND_7=$((${START_TIME} + 7 * 10 * 1000))
$ bq head ch11.time_lapse@${AROUND_3}-${AROUND_7}
+-------+---------------+
| index | millis |
+-------+---------------+
| 4 | 1395214742932 |
| 6 | 1395214766503 |
| 5 | 1395214754874 |
| 3 | 1395214731135 |
+-------+---------------+
This covers the full range of options that you can use to address a historical
view of a table. Now take a look at a couple of different ways you can use
these references. Here is a query that accesses only part of the table:
$ bq query \
"SELECT MIN(index), MAX(index)
FROM [ch11.time_lapse@${AROUND_3}-${AROUND_7}]"
+-----+-----+
| f0_ | f1_ |
+-----+-----+
| 3 | 6 |
+-----+-----+
Note that the table reference has to be quoted because it is not a valid
identifier. Other than that it behaves just like a regular table. An important
feature is that you are billed only for the portion of the table you scanned.
You can see this using the show command:
Search WWH ::




Custom Search