VIEW (INDEX)
Warning
Supported only for row-oriented tables. Support for column-oriented tables is currently under development.
To make a SELECT
by secondary index of row-oriented table statement, use the following:
SELECT *
FROM TableName VIEW IndexName
WHERE …
Examples
-
Select all the fields from the
series
row-oriented table using theviews_index
index with theviews >=someValue
criteria:SELECT series_id, title, info, release_date, views, uploaded_user_id FROM series VIEW views_index WHERE views >= someValue
-
JOIN
theseries
andusers
row-oriented tables on theuserName
field using theusers_index
andname_index
indexes, respectively:SELECT t1.series_id, t1.title FROM series VIEW users_index AS t1 INNER JOIN users VIEW name_index AS t2 ON t1.uploaded_user_id == t2.user_id WHERE t2.name == userName;