Schema and performance
Understand what your collections contain, enforce their structure, and find out why a query is slow.
Oxys DB Studio gives you the tools to look inside a collection and to see how the server handles your queries, without writing diagnostic commands by hand. Every tool on these pages runs through a command, so the same actions are available from the menus, the command line and AI agents.
| I want to… | Page |
|---|---|
| See which fields and types a collection really holds, and export that as documentation | Analyze a collection’s schema |
| Reject or flag documents that do not match a structure | Set validation rules |
| Create, edit, hide, copy or drop indexes | Manage indexes |
| See how the server runs a query, stage by stage | Explain a query |
| Watch server activity, find and kill long-running operations, read statistics | Monitor a server |
| Find a database’s slowest queries over the last hours or days | Find slow queries with the Query Profiler |
Before you start
- You need an open connection: see Connections.
- Most tools start from the connection tree: right-click a server, a database or a collection. The global toolbar also has Schema and Query Profiler buttons that act on the item selected in the tree.
- The examples use a sample database,
acme_store, with the collectionscustomers,ordersandproducts.
Safety
Reading tools (schema analysis, explain in its default mode, statistics, server status) never change your data. Tools that change the server, such as creating or dropping an index, saving a validator, killing an operation or switching the profiler on, are refused on a connection opened as read-only, and the destructive ones ask for confirmation first.
- Analyze a collection's schemaList every field of a collection with how often it appears and which types it holds, then explore, comment and document the result.
- Set validation rulesAdd, edit or remove a collection's validator, and choose whether invalid documents are rejected or only logged.
- Manage indexesList a collection's indexes with their size and usage, add and edit indexes, hide them from the planner, copy them to another collection, and drop them.
- Explain a querySee how the server runs a find query or an aggregation as a diagram of stages, with document counts, times and data read.
- Monitor a serverWatch live server activity, read server status and build information, find and kill long-running operations, and read collection and database statistics.
- Find slow queries with the Query ProfilerSwitch on the database profiler, list a database's slow find and aggregate queries over a period, and open or explain any of them.