Skip to main content
Once the share is mounted as a database in your account, it behaves like any other read-only database: ordinary SQL, your warehouses, your roles.
This page uses BLOCKWORKS as the local database name and clearly marked placeholder schema and view names. Substitute the names you actually see from the discovery queries below, which are the authoritative source for what your share contains.

Discover what you have

The share is self-describing. Start at the top and work down.
1

List the schemas

2

List the views in a schema

3

Inspect a view's columns

INFORMATION_SCHEMA works too, and is easier to filter and join:
Column and object comments carry the same descriptions as the Data API catalog where they are populated. Read them before guessing at a column’s meaning.

Set your session

Queries against the share run on your warehouse. Size it to the work: a small warehouse is fine for lookups and recent windows; scans across long histories will want more.

Query patterns

The examples below use placeholder names in angle brackets. They illustrate shape, not schema.

A point-in-time lookup

A time-bounded series

Timeseries-shaped objects carry a time column and a series key. Always bound the time range, because predicate pruning on the time column is what keeps these queries cheap.

An aggregation over a window

A period-over-period change

Joining entity metadata onto a series

Entity-shaped objects hold identity and metadata; timeseries-shaped objects hold history keyed by the same identifier. Joining them is the most common pattern in the share.

Joining to your own tables

This is the reason to use the share rather than the API. Blockworks data and your data are in the same warehouse, so they join like any other two tables.

Working efficiently

Bound the time column

Always constrain the time column on timeseries objects. An unbounded scan of full history is the single most common cause of a surprising bill.

Project only what you need

Select the columns you use rather than SELECT *. Columnar storage means narrow queries are genuinely cheaper.

Materialize repeated work

If several dashboards hit the same aggregate, build a table in your own database from the share and refresh it on a schedule.

Explore with LIMIT

When you first meet an object, look at it with a LIMIT before writing the real query. Snowflake still scans, so keep the predicate on.

Things to know

  • The share is read-only. You cannot write to it, add indexes, or alter its objects. Build derived tables in your own database.
  • Data updates in place. The provider refreshes the underlying models; you see the new data on your next query, with nothing to re-import.
  • Objects may be added over time. Re-run the discovery queries periodically rather than assuming a fixed inventory.
  • Definitions match the API. Metrics are modeled once and surfaced two ways, so a number in the share and the same number from the Data API are the same number.

Getting help

If you cannot find a dataset you expect to have, or a query is behaving unexpectedly, get in touch at blockworks.com/contact.