GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — geode-examples/indexes at develop · apache/geode-examples

Expand file tree

/

indexes

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

indexes

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
scripts
scripts
 
 
src/main/java/org/apache/geode_examples/indexes
src/main/java/org/apache/geode_examples/indexes
 
 
README.md
README.md
 
 

README.md

Outline

Geode OQL Indexing Example

This example demonstrates an index for OQL queries on a region.

A region can contain objects of arbitrary complexity, including objects that contain other objects. The values of a region can be queried using OQL and OQL queries can reference fields in the objects in the region. Indexes can be created to improve the performance of queries. Certain optimizations occur for top-level fields but indexes can also be created for nested fields, i.e., fields of objects that are contained with the objects in the region.

This example uses a mock database of passengers and flights stored in a single region. Since the region contains passenger objects, the index on passenger name uses a top-level field. Since flight code objects are contained within a passenger object, the index on airline code uses a nested field. After randomly populating the mock database, this example shows the results of queries that use no index, a top-level index, and a nested index.

This example assumes that Java and Geode are installed.

Steps

  1. From the geode-examples/indexes directory, build the example and run unit tests.

     $ ../gradlew build
    
  2. Next start the locator and two servers.

     $ gfsh run --file=scripts/start.gfsh
    
  3. Run the example to create indexes in the region.

     $ ../gradlew run
    
  4. Shut down the system.

     $ gfsh run --file=scripts/stop.gfsh
    
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.