Tips and Tricks

Sort by ID field

The _id field contains info about creation timestamp. It means that sorting on an _id field is roughly equivalent to sorting by created_at field, but works much faster because _id field has predefined index.

Hence it is highly recommended to use sort by _id field instead of sort by created_at field:

curl -X GET -d "sort_desc=_id&limit=10" -H "QB-Token: 4d617908bf432bd0a72e2e089ed500e76a2c1a3b" https://api.quickblox.com/data/Message

Skip parameter performance

The skip parameter is often expensive because it requires the server to walk from the beginning of the collection to get the offset or skip position before beginning to return result. As offset increases, skip will become slower and more CPU intensive. With larger collections, skip may become IO bound.

Instead of using big value of skip try to improve your query. Maybe you don't need it.