Enhancing Productivity: How We made Command + K Search More Than 5x Faster

With SingleStore Helios®, we continuously strive to elevate our users' experience, focusing on speed, efficiency and technical excellence.

Enhancing Productivity: How We made Command + K Search More Than 5x Faster

One of our latest updates centers around significant performance optimizations to the Command + K feature — our powerful, unified search interface.

Understanding Command + K search on Helios

Command + K search in Helios operates entirely on the frontend. When users invoke the search, our frontend directly queries the information_schema of the database via WebSockets, fetching the necessary content dynamically to surface relevant results. Every activation of the search box initiates a sequence of SQL queries from the frontend, retrieving various database items like views, aggregates, procedures, pipelines, tables and UDFs (user-defined functions).

Technical performance improvements

Prior to optimization, activating Command + K resulted in substantial workloads:

  • One of our internal organizations manages over 150 databases on Helios, with each search invocation executing over 2,500 individual SQL queries.
  • Combined with React rendering overhead, the total execution time amounted to approximately 730 seconds, including parallel execution durations averaging 120+ seconds per database item.

Recognizing the critical need for enhancement, we implemented strategic optimizations across both SQL and React layers:

SQL optimizations

  • Unified SQL query approach. Capitalizing on SingleStore’s powerful and efficient query engine, we consolidated multiple SQL queries for various database items into a single unified query using SQL unions. This method leverages SingleStore’s robust architecture, allowing significant query consolidation without any performance degradation.

React optimizations

  • Refactoring rendering logic. Completely restructured our React rendering logic from the ground up.
  • Removal of redundant logic. Eliminated unnecessary React hooks (useEffects, useStates), excessive loops and redundant state updates, significantly streamlining the React rendering pipeline.

Quantified impact of optimizations

The resulting improvements were remarkable:

Metric

Before optimization

After optimization

Improvement

SQL queries

2,500+

96

~96% reduction

Execution time (sequential)

~730 seconds

~20 seconds

~97% reduction

Execution time (parallel)

~120 seconds

~20 seconds

~84% improvement

Collectively, these enhancements provided users with at least 5x faster, highly efficient search experience.

User experience enhancements

In addition to technical improvements, we enhanced user interactions with Command + K:

  • Streamlined UI. Redesigned interface for greater clarity and ease of use.

  • Optimized keyboard navigation. Enhanced speed and accessibility through advanced keyboard shortcuts.
  • Advanced fuzzy matching. Improved search reliability, effectively handling misspellings (e.g., "daranase" correctly returning "database").

  • Sectional search capability. Quickly identify sections including tables, without needing precise details.
  • Instantaneous search results. Instant visual feedback during typing, enhancing responsiveness.

Looking forward

We remain dedicated to ongoing optimization and enhancement, with more improvements already underway. Stay tuned for future updates!

Start building with SingleStore