RavenDBA Deep Dive into Indexes                           S
Alonso RoblesS Principal Consultant @ HeadspringS Blog: http://alonsorobles.comS Linked In: http://linkedin.com/in/alonsor...
Central TexasGiveCampSeptember 28-30, 2012Interested in Participating?    Developer – Make software. Have fun. Do    good!...
The QueryHow does RavenDB find what we are looking                                     for?                               ...
Simple Query
What Happens?           .NET Client           sends queryServer returns        Server   results        processes query
How is the Query Processed?
The IndexA short and brief introduction                                 S
ACID versus BASE               ACID                     BASES   Atomic             S   Basically AvailableS   Consistent  ...
ACID Document OperationsS StoreS DeleteS Update
BASE QueriesS FastS Stale ResultsS   Powered by Lucene
LuceneS Mature, De Facto Standard Information Retrieval LibraryS Scalable, High Performance IndexingS Powerful, Accurate a...
Types of IndexesS Temporary Dynamic Index  S Created on the fly to service a query when no existing index     can be usedS...
Static IndexesWhy? Aren’t the dynamic indexes enough?                                          S
Reasons for Static IndexesS Index Creation is ExpensiveS Additional Functionality  S Custom Sorting  S Boosting  S Full-Te...
Simple Index Definition
Using the Index in a Query
Reducing Results
Using Sort Options
Even More Options
Live Projections
Stale Indexes    Working with staleness                             S
Why Must It Be Stale?S Indexing occurs on a background threadS Keeps queries lightning fastS Better to be stale than offline
Checking for Stale Results
But Non-Stale Won’t Do
Questions     Ask away!                 S
More InfoS Official Raven Website: http://ravendb.netS Oren’s Blog: http://ayende.comS Google Group: http://groups.google....
Upcoming SlideShare
Loading in …5
×

RavenDB - Indexes Deep Dive

2,501 views

Published on

Published in: Technology, Business
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,501
On SlideShare
0
From Embeds
0
Number of Embeds
471
Actions
Shares
0
Downloads
0
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide
  • Every index is required to have a name and a Map function. The Map function is the way for us to tell RavenDB how to find the data we are interested in, and what fields we are going to be searching on. The Map function is written in LINQ, just like you'd write a simple query
  • The Reduce function is optional, and is written and executed just like the Map function, but this time on the results of the Map function. This is actually a second indexing pass, which allows us to perform aggregation operations quite cheaply, directly from the index.
  • Sorting by default is performed lexographically.
  • FieldStorageNo (default) – Does not store the value of the field in the indexYes – Stores the value of field Compress – Compresses the value of the field (good for long text or binary fields)FieldInexing OptionsAnalyzed – Standard analysis good for full text search or text fields (breaks up text into terms and performs stemming analysis)Default – LowerCaseKeywordAnalyzer (stores the entire field as a single term for exact matching)No – Field is not indexed thus cannot be searched. But it can still be accessed assuming it was stored.NotAnalyzed – Indexes the field without performing analysis. This is good for unique ids like product numbers (UPC, ISBN, MPN)
  • Using the Live Projections feature, you have more control over what to load into the result entity, and since it returns a projection of the original entity, you also get the chance to filter out properties you do not need.
  • WaitForNonStaleResultsAsOf()WaitForNonStaleResultsAsOfNow()WaitForNonStaleResultsAsOffLastWrite()
  • RavenDB - Indexes Deep Dive

    1. 1. RavenDBA Deep Dive into Indexes S
    2. 2. Alonso RoblesS Principal Consultant @ HeadspringS Blog: http://alonsorobles.comS Linked In: http://linkedin.com/in/alonsoroblesS Twitter: @alonsorobles
    3. 3. Central TexasGiveCampSeptember 28-30, 2012Interested in Participating? Developer – Make software. Have fun. Do good! Non-Profit – What can we build for you? Sponsor – Help make the even successful.More Info:http://ctxgivecamp.org
    4. 4. The QueryHow does RavenDB find what we are looking for? S
    5. 5. Simple Query
    6. 6. What Happens? .NET Client sends queryServer returns Server results processes query
    7. 7. How is the Query Processed?
    8. 8. The IndexA short and brief introduction S
    9. 9. ACID versus BASE ACID BASES Atomic S Basically AvailableS Consistent S Soft stateS Isolated S Eventually consistentS Durable
    10. 10. ACID Document OperationsS StoreS DeleteS Update
    11. 11. BASE QueriesS FastS Stale ResultsS Powered by Lucene
    12. 12. LuceneS Mature, De Facto Standard Information Retrieval LibraryS Scalable, High Performance IndexingS Powerful, Accurate and Efficient Search AlgorithmsS Originally Written in Java and Ported to Many LanguagesS Used by Apple, IBM, Linked In and many more…
    13. 13. Types of IndexesS Temporary Dynamic Index S Created on the fly to service a query when no existing index can be usedS Permanent Dynamic Index S Promoted when a temporary index is used a lotS Static Index S User defined
    14. 14. Static IndexesWhy? Aren’t the dynamic indexes enough? S
    15. 15. Reasons for Static IndexesS Index Creation is ExpensiveS Additional Functionality S Custom Sorting S Boosting S Full-Text Search S Live Projections S Spatial Search
    16. 16. Simple Index Definition
    17. 17. Using the Index in a Query
    18. 18. Reducing Results
    19. 19. Using Sort Options
    20. 20. Even More Options
    21. 21. Live Projections
    22. 22. Stale Indexes Working with staleness S
    23. 23. Why Must It Be Stale?S Indexing occurs on a background threadS Keeps queries lightning fastS Better to be stale than offline
    24. 24. Checking for Stale Results
    25. 25. But Non-Stale Won’t Do
    26. 26. Questions Ask away! S
    27. 27. More InfoS Official Raven Website: http://ravendb.netS Oren’s Blog: http://ayende.comS Google Group: http://groups.google.com/group/ravendb/S My Blog: http://alonsorobles.comS Local Training: http://headspring.com

    ×