--- title: "How do I write queries faster?" slug: "how-do-i-write-queries-faster" updated: 2026-10-23T12:22:11Z published: 2026-10-23T12:22:11Z canonical: "support.lusid.com/how-do-i-write-queries-faster" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.lusid.com/llms.txt > Use this file to discover all available pages before exploring further. # How do I write queries faster? LumiCode's editor knows Luminesce: it completes provider and field names as you type, brings back anything you've run before, tidies a query's layout with one key, and can run just the part of a long script you're working on. A few keys make a real difference to how quickly you get from a question to an answer. ## Prerequisites - LumiCode installed and signed in. See [How do I install LumiCode?](/v1/docs/how-do-i-install-lumicode) - You've run a query or two. If not, start with [Getting started with LumiCode](/v1/docs/getting-started-with-lumicode). ## Methods ### Method 1: Let completion do the typing 1. Start typing, for example `select * from Lusid.Ins`. 2. Press Tab, or Ctrl+Space, to open the completions. 3. Use ↑ ↓ to choose one, and press Tab or Enter to accept it. Esc closes the list. Accepting a word adds the space after it, so pressing Tab repeatedly builds up a line a word at a time. When an item's documentation is too long for its panel, PgUp and PgDn scroll it. ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image-2S7J7FOQ.png?sv=2026-02-06&spr=https&st=2026-11-18T19%3A34%3A45Z&se=2026-11-18T20%3A34%3A45Z&sr=b&sp=r&sig=UfOQN91Ejbmyk2ywDq9ZEaFLV4EeiXjN63L53FKM3bM%3D) ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image-Q2MG9SV9.png?sv=2026-02-06&spr=https&st=2026-11-18T19%3A34%3A45Z&se=2026-11-18T20%3A34%3A45Z&sr=b&sp=r&sig=10oJCQVdWVG%2B2h092rjqERzooaJ1zrr17hqWOpBgRLM%3D) This covers far more than Providers and Fields from the catalog, but includes full Function, Operator and SQL key word syntax code completion, wherever they are valid. ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image-8S33PI0C.png?sv=2026-02-06&spr=https&st=2026-11-18T19%3A34%3A45Z&se=2026-11-18T20%3A34%3A45Z&sr=b&sp=r&sig=4K9MKcXCiLZwV9RXuBlMeOZp7y%2BgNF4pGrh%2FQf8d44w%3D) Completion works for LumiCode's own commands too: on a line that starts with `/`, it offers commands rather than SQL. ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image-6K6HMLIL.png?sv=2026-02-06&spr=https&st=2026-11-18T19%3A34%3A45Z&se=2026-11-18T20%3A34%3A45Z&sr=b&sp=r&sig=8V2UX0x8CgqHcXGi%2Fk2PVGFUDq6NdQYw2dvhHh7Hqcg%3D) ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image-P7NP5EIZ.png?sv=2026-02-06&spr=https&st=2026-11-18T19%3A34%3A45Z&se=2026-11-18T20%3A34%3A45Z&sr=b&sp=r&sig=ejY4XMXJkGKwgSzrIPC%2FqiaIEOkcoAkgTeukPoFIdGg%3D) ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image-GL1SISK5.png?sv=2026-02-06&spr=https&st=2026-11-18T19%3A34%3A45Z&se=2026-11-18T20%3A34%3A45Z&sr=b&sp=r&sig=8nzOTCdsaHyZykd%2FCxJaS7yZJv5Pe6F%2BqPyfnQHiHMc%3D) On a Mac macOS may use Ctrl+Space to switch input sources. If it does, use Tab instead. ### Method 2: Bring back a query you've run - Press ↑ and ↓ to step through your recent queries. - For older queries, or to search for one, see [How do I find and re-run a past query?](/v1/docs/how-do-i-find-and-re-run-a-past-query) ### Method 3: Write over several lines Enter runs the query. To start a new line instead, press Shift+Enter or Ctrl+J. Most macOS terminals send Shift+Enter as a plain Enter. Either use Ctrl+J, or set your terminal to send a newline for Shift+Enter. If you'd rather Enter started a new line, `/set enter newline` swaps the two over. ### Method 4: Tidy the layout Press Ctrl+P to format the query in the editor. `/pretty` prints the last query you ran, formatted, into the transcript. ### Method 5: Run part of a script 1. Hold Shift and use the arrow keys to select the part you want. 2. Press Ctrl+R. LumiCode runs what is selected and nothing else. Enter always runs everything in the editor. To run several separate queries side by side, see [How do I run several queries together as a multi-query?](/v1/docs/how-do-i-run-several-queries-together-as-a-multi-query) ### Method 6: Use your own editor For a long query, press Ctrl+X to open it in your own text editor. When you save and close it, the query comes back into LumiCode. To choose which editor opens, use `/set editor`. ## Moving about and copying - Option+← and Option+→ (Alt on Windows and Linux) move a word at a time, as do Ctrl+← and Ctrl+→. Add Shift to select as you go. - Home and End go to the ends of the line. PgUp and PgDn move a page through a long query. - Clicking puts the cursor where you clicked. - Ctrl+C copies what's selected. With nothing selected, it clears the line. - Ctrl+V pastes. - Esc clears the line. Copying on a Mac In the editor, Cmd+C doesn't copy: use Ctrl+C. Ctrl+X opens your editor rather than cutting, so to cut, select, press Ctrl+C, then type over the selection. ## Appendix: Editor keys | Key | What it does | | --- | --- | | Enter | Runs everything in the editor | | Shift+Enter or Ctrl+J | Starts a new line | | Ctrl+R | Runs only what is selected | | Tab or Ctrl+Space | Opens completions | | ↑ ↓ | Recalls recent queries | | Ctrl+P | Formats the query | | Ctrl+X | Opens the query in your own editor | | Ctrl+C | Copies the selection, or clears the line. Pressed again on an empty line, it leaves LumiCode. | | Esc | Closes completions, or clears the line | For every key, type `/help keys` in LumiCode. ## Related articles - [How do I use Candela to write or fix a query?](/v1/docs/how-do-i-use-candela-to-write-or-fix-a-query) - [A tour of LumiCode](/v1/docs/a-tour-of-lumicode)