This shows you the differences between two versions of the page.
admin:indexing:activecounts:sql [2011/01/21 16:19] els |
admin:indexing:activecounts:sql [2016/06/28 22:38] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{page>:top_add&nofooter&noeditbtn}} | ||
- | ====== Administration: Omnidex Indexing ====== | ||
- | |||
- | ===== ActiveCounts ===== | ||
- | |||
- | [[admin:indexing:activecounts:home|Overview]] | | ||
- | [[admin:indexing:activecounts:example|Example]] | | ||
- | **[[admin:indexing:activecounts:sql|SQL]]** | | ||
- | [[admin:indexing:activecounts:optimization|Optimization]] | | ||
- | [[admin:indexing:activecounts:tips|Tips]] | ||
- | |||
- | ---- | ||
- | |||
- | ==== The SQL Behind ActiveCounts ==== | ||
- | |||
- | The example on the previous page demonstrated ActiveCounts in a web page; however, ActiveCounts is not a set of web controls. ActiveCounts is really just a powerful set of SQL statements that are highly optimized using the Omnidex indexes. This means that ActiveCounts can be implemented in any application that calls SQL. | ||
- | |||
- | ActiveCounts is accomplished using SQL statements that request a set of values and their counts based on the criteria so far. The following basic SQL statements supply the counts needed for the example on the previous page. | ||
- | |||
- | First, the user requested to see the states and their counts: | ||
- | |||
- | select STATE, count(*) | ||
- | from LIST | ||
- | group by STATE | ||
- | |||
- | The user selected the states in the Western United States, and then requested to see the Genders and their counts: | ||
- | |||
- | select GENDER, count(*) | ||
- | from LIST | ||
- | where STATE in ('AZ','CA','CO','NM','OR','UT','WA') | ||
- | group by GENDER | ||
- | |||
- | The user selected the Women in the Western United States, and then requested to see the Educations and their counts: | ||
- | |||
- | select EDUCATION, count(*) | ||
- | from LIST | ||
- | where STATE in ('AZ','CA','CO','NM','OR','UT','WA') and | ||
- | GENDER = 'F' | ||
- | group by EDUCATION | ||
- | |||
- | The user selected those people with graduate degrees, and may have continued narrowing his search. | ||
- | |||
- | As you can see, these SQL statements simple request counts that are filtered by the criteria entered so far, grouped by the next value they want to see. The simplicity of this approach allows it to be more easily integrated into an application. | ||
- | |||
- | |||
- | |||
- | First, the user requested to see the states and their counts: | ||
- | |||
- | |||
- | ===== ===== | ||
- | |||
- | **[[admin:indexing:activecounts:example|Prev]]** | | ||
- | **[[admin:indexing:activecounts:optimization|Next]]** | ||
- | |||
- | ====== Additional Resources ====== | ||
- | |||
- | See also: | ||
- | |||
- | {{page>:admin:indexing:see_also&nofooter&noeditbtn}} | ||
- | |||
- | {{page>:bottom_add&nofooter&noeditbtn}} |