# DB01002: Query Timeout

## What This Means[​](#what-this-means "Direct link to What This Means")

A database operation took too long to complete. The local database query exceeded the maximum allowed time.

## Common Causes[​](#common-causes "Direct link to Common Causes")

* **Large data set** — Very large number of products or records
* **Complex query** — Query involving many conditions
* **Device performance** — Device is running slowly
* **Database fragmentation** — Database needs optimisation

## How to Fix[​](#how-to-fix "Direct link to How to Fix")

### 1. Wait and Retry[​](#1-wait-and-retry "Direct link to 1. Wait and Retry")

The query may succeed on retry:

* Close and reopen the POS
* Try the operation again
* Avoid other intensive operations simultaneously

### 2. Close Other Applications[​](#2-close-other-applications "Direct link to 2. Close Other Applications")

Free up device resources:

* Close unused browser tabs
* Close other applications
* Restart the device if needed

### 3. Reduce Data Scope[​](#3-reduce-data-scope "Direct link to 3. Reduce Data Scope")

If searching:

* Use more specific search terms
* Apply filters to narrow results
* Break large operations into smaller ones

### 4. Optimise the Database[​](#4-optimise-the-database "Direct link to 4. Optimise the Database")

Check for unsaved work first

Clearing local data or reinstalling the app deletes anything on this device that hasn't reached your store — including sales taken while offline, open carts, and edits that didn't save. Before you clear anything, open **Store health → Database** and check nothing is listed as held or as never having reached your server, then **Store health → Logs** for **0 stuck records** and **0 changes waiting to send**; then finish or note every open cart. If your WCPOS has no Store health page, update WCPOS first, then check. If anything is listed or waiting, or you can't check, don't clear — ask your store owner or contact support.

Only if the other steps on this page didn't help, and only after the check above, clear and re-sync:

1. Clear local data (settings option if available)
2. Login again
3. Let data sync fresh

### 5. Check Device Performance[​](#5-check-device-performance "Direct link to 5. Check Device Performance")

Ensure your device meets requirements:

* Sufficient RAM
* Adequate processor speed
* SSD preferred over HDD

## Large Catalogues[​](#large-catalogues "Direct link to Large Catalogues")

If you have a very large product catalogue:

* Initial sync takes longer
* Consider using filters in the POS
* Some operations naturally take more time
* Contact support for optimisation advice

## Related Errors[​](#related-errors "Direct link to Related Errors")

* [DB01001](/error-codes/DB01001.md) — Connection Failed
* [DB01003](/error-codes/DB01003.md) — Transaction Failed
