Seen and tried Big Objects and seem great, except that lookups seem backward to me...I'm sure for a reason. Not looking for the reason.

I want to see how I can lookup from a Custom Object record TO a Big Object record? Workarounds that you are using for this?

I know you could use the ID of a BO record and put as text on a Custom Object but that seems dangerous? Id hardcoding never good. If you've used, ok how, else what else? Thanks!

1 Answer 1


The current best practice is to create fields on the target object that reference the index fields on the source object. Index fields (up to 5) form the unique key on the Big object. This is not the same as the Id on a regular object and not necessarily dangerous.

To Query Big Objects you use standard SOQL or Async SOQL. Standard SOQL is recommended when:

  • You want to display the results in the UI without having the user wait for results
  • You want results returned immediately for manipulation within a block of Apex code.
  • You know that the query will return a small amount of data.

You use Async SOQL when:

  • You are querying against millions of records.
  • You want to ensure that your query completes.
  • You don’t need to do aggregate queries or filtering outside of the index.

There are two main ways to use Async: Filtering and coarse aggregations.

I Recommend browsing through a trailhead about this subject.

  • I do remember reading that but to confirm, if my Big Object was all the stock prices for last year and key was: ticker, datetime, exchangename, then I'd create 4 or 5 fields on target (ticker, datetime, exchangename, price (not part of key) and probably BigObjectname) and use these to build query on BO? Then create new record or whatever accordingly based on BO query? So I have to keep these in sync of course in case change.
    – ddeve
    Commented May 20, 2018 at 3:48
  • This is indeed how it works (standard SQL like in relational databases in fact). I edited my answer for more detail
    – user28311
    Commented May 20, 2018 at 8:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .