Skip to main content

SOQL with Big Objects

SOQL with Big Objects

You can query the fields in a big object’s index using a subset of standard SOQL commands.
Build an index query starting from the first field defined in the index, without gaps between the first and last field in the query. You can use =<><=, or >=, or IN on the last field in your query. Any prior fields in your query can only use the = operator. The !=LIKENOT INEXCLUDES, and INCLUDES operators are not valid in any query.
You can include the system fields CreatedByIdCreatedDate, and SystemModstamp in queries. To retrieve a list of results, do not use the Id field in a query. Including Id in a query returns only results that have an empty ID (000000000000000 or 000000000000000AAA).

The following queries assume that you have a table in which the index is defined by LastName__cFirstName__c, and PhoneNumber__c.
This query specifies all three fields in the index. In this case, the filter on PhoneNumber__c can be a range.
SELECT LastName__c, FirstName__c, PhoneNumber__c
FROM Phone_Book__b
WHERE LastName__c='Kelly' AND FirstName__c='Charlie' AND PhoneNumber__c='2155555555'
===============
This query specifies only the first two fields in the index. In this case, the filter on FirstName__c can be a range.
SELECT LastName__c, FirstName__c, PhoneNumber__c
FROM Phone_Book__b
WHERE LastName__c='Kelly' AND FirstName__c='Charlie' 
==================
This query specifies only the first field in the index. The filter on LastName__c can be a range.
SELECT LastName__c, FirstName__c, PhoneNumber__c
FROM Phone_Book__b
WHERE LastName__c='Kelly'
========================
This query doesn’t work because of a gap in the query where FirstName__c is required.
SELECT LastName__c, FirstName__c, PhoneNumber__c
FROM Phone_Book__b
WHERE LastName__c='Kelly' AND PhoneNumber__c='2155555555'
=================
These restrictions do not apply to Async SOQL queries against big objects.

Comments

Popular posts from this blog

Define & View Custom Big Object

Define a Custom Big Object: You can define custom big objects with Metadata API or in Setup. After you define and deploy a big object, you can view it or add fields in Setup. After you’ve deployed a big object, you can’t edit or delete the index. To change the index, start over with a new big object. To define a big object in Setup, see Salesforce Help. View a Custom Big Object in Setup After you’ve deployed your custom big object, you can view it by logging in to your organization and, from Setup, entering  Big Objects  in the  Quick Find  box, then selecting  Big Objects . Click the name of a big object, to see its fields and relationships. View a Custom Big Object in Setup After you’ve deployed your custom big object, you can view it by logging in to your organization and, from Setup, entering  Big Objects  in the  Quick Find  box, then selecting  Big Objects . Click the name of a big object, to see its fields and ...

ASYNC SOQL - with Big Objects

Async SOQL Async SOQL is a method for running SOQL queries when you can’t wait for immediate results. These queries are run in the background over Salesforce big object data. Async SOQL provides a convenient way to query large amounts of data stored in Salesforce. Async SOQL is implemented as a RESTful API that enables you to run queries in the familiar syntax of SOQL. Because of its asynchronous operation, you can subset, join, and create more complex queries and not be subject to timeout limits. This situation is ideal when you have millions or billions of records and need more performant processing than is possible using synchronous SOQL. The results of each query are deposited into an object you specify, which can be a standard object, custom object, or big object. The limit for Async SOQL queries is one concurrent query at a time. Async SOQL Versus SOQL SOQL and Async SOQL provide many of the same capabilities. So when would you use an Async SOQL query instead of s...

Publish Paltform Events

Publishing Platform Events The Salesforce enterprise messaging platform offers the benefits of event-driven software architectures. Platform events are the event messages (or notifications) that your apps send and receive to take further action. Platform events simplify the process of communicating changes and responding to them without writing complex logic.  Publishers and subscribers communicate with each other through events.  One or more subscribers can listen to the same event and carry out actions. Here we will see how many ways you can able to publish the platform events in Salesforce.  After a platform event has been defined in your Salesforce org, publish event messages from a Salesforce app using processes, flows, or Apex or an external app using Salesforce APIs.Here is the simple platform event object we will be using in the examples here Here are the different ways you can able to publish the platform events in Salesforce Option 1: Using Proces...