mirror of
https://github.com/lancedb/lancedb.git
synced 2026-10-16 08:42:29 +00:00
This PR is part of the documentation revamp. Once the full set of PRs is merged, we’ll publish the combined site to staging for review before updating docs.lancedb.com. The introductory pages are inconsistent, and the old PR split asked reviewers to review some pages twice. This brings the final quickstart, connection guide, architecture and Concepts pages together. It clarifies OSS and Enterprise, simplifies naming rules and includes the navigation and diagram fixes from #4489. Function and Secret details on the Concepts pages are MDX comments until their release, and CONTRIBUTING.md explains how to write docs before a release. Includes #4532. Ingestion, search and integrations are in #4533; data workflows, SQL and operations are in #4534. Each MDX file has one PR owner. Local assembly, Mint validation and link checks pass. The Function pages stay published from `main` until #4534 hides them, so hold publication until the complete stack is integrated.
56 lines
2.5 KiB
Plaintext
56 lines
2.5 KiB
Plaintext
---
|
|
title: "Queries"
|
|
sidebarTitle: "Query"
|
|
description: "Choose how to query your data and read the results."
|
|
icon: magnifying-glass
|
|
keywords: ["query", "search", "SQL", "async", "streaming", "results"]
|
|
---
|
|
|
|
## Querying tables {#queries}
|
|
|
|
A query selects data from your tables. You can filter rows, choose columns,
|
|
search for similar content or combine those operations. For example, a video
|
|
application might find clips similar to a sample and return only those recorded
|
|
in the last month.
|
|
|
|
## SDK searches and SQL queries {#searches}
|
|
|
|
| Interface | When to use it |
|
|
| --- | --- |
|
|
| **SDK query builders** | Build vector, full-text and hybrid searches, apply filters and choose the fields to return. Available in OSS and Enterprise. |
|
|
| **Enterprise SQL** | Write SQL queries for filtering, aggregation, joins and other data curation tasks. Connect through Python or a Flight SQL client. |
|
|
|
|
Both interfaces work with LanceDB tables. Choose the one that supports your
|
|
operation and fits your application. See [SQL](/basics/sql) for connection
|
|
instructions and SQL search support, and [Search](/search) for the query builders.
|
|
|
|
## Collect or stream results {#results}
|
|
|
|
- **Collect the results** when you want a list, Arrow table or DataFrame that
|
|
fits in memory. Use a result limit and select only the columns you need.
|
|
- **Read batches** when you want to process a large result incrementally.
|
|
Reading batches avoids loading the entire result into application memory.
|
|
It does not guarantee that the query can return its first batch immediately.
|
|
|
|
### Asynchronous clients {#async-client}
|
|
|
|
An async client lets your application do other work while a request is waiting.
|
|
That is separate from whether you collect results or read them in batches.
|
|
Python offers synchronous and asynchronous clients; TypeScript uses async APIs.
|
|
Check the SDK reference for the methods available in your client.
|
|
|
|
### Query handles and background jobs {#jobs}
|
|
|
|
An Enterprise SQL query handle lets you inspect query execution and request
|
|
cancellation. Background operations such as index builds return a
|
|
[job](/basics/jobs) handle instead. Use the API for the returned handle to
|
|
check status and retrieve results.
|
|
|
|
## Learn more {#next}
|
|
|
|
- [Quickstart](/quickstart): run a complete create, insert and search example.
|
|
- [Search](/search): choose vector, full-text or hybrid retrieval.
|
|
- [Filtering](/search/filtering): narrow results with predicates.
|
|
- [SQL](/basics/sql): connect a client and run SQL queries.
|
|
- [SDKs](/basics/sdk): choose a language and find its API reference.
|