Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Tips to improve Query Performance

What are some of the best practices of optimising gosu query performance ?

Posted one year ago
Votes Newest

Answers 4

While there are many functions, here is a handy list of properties that should be used whenever a [color=blue]query API[/color] is used to fetch results.

Empty – Informs whether the result set (of multiple items) is empty. The common mistake is to use Count property just to understand if there are rows that match the query. Do not use Count property if we only want to know if there are rows that match our query in the data set. Relational query performance often improves if you use Empty property.

Pls use the following best practices

// Correct

var results = Query.make(Person).compare(Person#Code,Equals, code). withLogSQL(true).select()
if(results.Empty) // This is the right WAY !
     // Logic here 


var results = Query.make(SomeEntity).compare("Code_Ext", Equals, code).withLogSQL(true).select()

if(results.Count > 0) // This is NOT the right WAY !{ 
     // Logic here 

• AtMostOneRow – Use this whenever a maximum of 1 result is expected.

var account =  Query.make(Account).compare(Account#AccountNumber, Equals, accountNumber).select().AtMostOneRow

FirstResult – DO NOT use first(). The first() function loads the entire result set into a collection. Instead use FirstResult , when multiple results may be retrieved, but any result from the result set would suffice. Relational query performance often improves when we use the FirstResult property to access only the first item in a result.

var result = Query.make(Person).compare(Person#Code,Equals, code). withLogSQL(true). select().FirstResult

Posted one year ago


Gordon Freeman   10 months ago Report

This is a thing: file

Posted 11 months ago

testFunc() {

Posted 10 months ago

q buy cialis online Thunda https://ascialis.com/ - safe cialis online PerPragree Flagyl Generic Form Envict <a href=https://ascialis.com/#>Cialis</a> Lopsleno Furosomide Online

Posted 8 months ago

Your answer

4 Answers
one year ago
8 months ago
Similar posts