When YQL runs a SELECT statement, it accesses a back-end datasource, typically by calling a Web service. Remote filters and limits are implemented by the back-end Web service. Local processing (including local filters and limits) is performed by the YQL Web Service on the data it fetches from the back-end Web service. As shown by the following example, whether an operation is remote or local affects the data returned to the application that calls the SELECT statement.
The following SELECT statement gets data about pizza restaurants from the
The steps that follow show the order in which YQL processes the remote and local parts of the SELECT statement:
search.webtable, at the following URL:
By calling this URL, YQL gets the first 50 items that match the SELECT statement's
query element is
an input key for the
search.web table. Although the remote filter in
the SELECT is set to 500, to improve efficiency, YQL only fetches 50 items each time it
((title like 'Round%') or (abstract matches '.*about.*')). This filter selects an item if the
titlefield (column) starts with
about. In this example, from the set of 50 items, YQL finds 3 items that match the local filter.
urlfields, which are specified after the SELECT keyword.
startparameter to 50, to get the next 50 rows:
On this second set of 50 items, YQL applies the local filter, but finds no matches.
urlfields exist. This time, YQL finds 2 more matches, which brings the total number of matches to 5. Because the local limit of 5 has been reached, YQL does not call BOSS again.
sortfunction, ordering the data by the
urlfields) to the calling Web application.
The following table identifies whether an element in the SELECT statement is processed locally or remotely by YQL.
|Syntax Element in SELECT||Local or Remote||Section With Details|
|Columns or asterisk after the SELECT keyword.||Local||Specifying the Elements Returned (Projection)|
|Remote limit and offset, indicated by integers in parentheses after the table name.||Remote||Remote Limits|
|Remote filter expression in the WHERE clause. The allowed operators are the equal sign or IN. The value compared is an input key for the back-end datasource.||Remote||Remote Filters|
|Local filter expression in the WHERE clause. Various operators are allowed, including LIKE and MATCH. The value compared is a field (column) in the data returned by the query.||Local||Local Filters|
|LIMIT and OFFSET keywords after the WHERE clause.||Local||Local Limits|
|Sort and other functions after the pipe (|) symbol.||Local||Sort and Other Functions|