Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

[Firestore] Throwing 14 UNAVAILABLE: Query timed out on "simple" query #2055

@abarone-btf

Description

@abarone-btf

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

  1. Is this a client library issue or a product issue?
    Yes its the client library

  2. Did someone already solve this?

  • The problem is very weird, dont know if just my case
  1. Do you have a support contract?
    No

Environment details

  • OS: Linux and Mac
  • Node.js version: 18
  • npm version: 10.5.0
  • @google-cloud/firestore version: 7.6.0

Steps to reproduce

  1. Am just making a "simple" query that uses the OR operator and the new inequality operator on multiple fields, the query is searching over an Id that its repeated on my database with aprox 27k items:

This is an example of the query:

            .where('myId', '==', 123)
            .where('createdAt', '<=', new Date())
            .where(
                Filter.or(
                    Filter.where('deletedAt', '>=', new Date()),
                    Filter.where('deletedAt', '==', null)
                  )
            )
            .orderBy('createdAt', 'desc')
            .limit(500)
  1. The query just hangs out and never finished, throwing the error 14 UNAVAILABLE: Query timed out. Please try either limiting the entities scanned, or run with an updated index configuration..

What may be happening here?, maybe am missing some weird index?, I tried to run the explain function but with the analyze flag the result is the same, without it, the plan summary its this one:

 PlanSummary {
  indexesUsed: [
    {
      properties: '(myId ASC, createdAt DESC, deletedAt DESC, __name__ DESC)',
      query_scope: 'Collection'
    },
    {
      properties: '(myId ASC, deletedAt ASC, createdAt DESC, __name__ DESC)',
      query_scope: 'Collection'
    }
  ]
}

Thanks in advance!

Metadata

Metadata

Assignees

Labels

api: firestoreIssues related to the googleapis/nodejs-firestore API.needs more infoThis issue needs more information from the customer to proceed.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions