Slow Query Performance in PouchDB with Synced CouchDB Index

オープン
#8,995 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
javascript
領域
databases

調査の方向性

この issue には、開始するためのリポジトリファイル、テスト、エントリポイントがありません。IndexedDB アダプターを使用してブラウザーでクエリを再現し、同期されたインデックスと createIndex() を介して作成したインデックスを比較し、getIndexes() を調べます。同期されたインデックスが使用されているかを特定し、サポートされる動作を文書化できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

I am experiencing slow query performance in PouchDB despite using an index synced from CouchDB. Below are the details of my setup and the issue:

setup
This is my index in CouchDB

{
"_id": "_design/employee-index",
"_rev": "9-853ffb68171b1e78206646d0a63c22bc",
"language": "query",
"views": {
"residents-index": {
"map": {
"fields": {
"firstName": "asc",
"projectId": "asc"
},
"partial_filter_selector": {}
},
"reduce": "_count",
"options": {
"def": {
"fields": [
"firstName",
"projectId"
]
}
}
}
}
}

PouchDB sync

I have synced the above index from CouchDB to PouchDB.
The index appears in IndexedDB as pouch_employee_mrview. It has records.

Query

db.find({
selector: {
projectId: 'specificProjectId',
firstName: { $gte: null }
},
use_index: '_design/employee-index'
}).then(function (result) {
console.log(result.docs);
}).catch(function (err) {
console.error(err);
});

Issue

Despite using the use_index field in my query, the performance is still slow

Info
  • Environment: browser (using pouchdb-browser)
  • Platform: (Chrome/FF/Safari/Edge/iOS/Android/etc.)
  • Adapter: indexeddb
  • Server: CouchDB
My questions
  1. Since I have created the Index at CouchDB and synced with PouchDB, Is it not using the Index properly?
  2. Do I need to recreate the index using createIndex() from Pouch side? I queried the PouchDB index using getIndexes(). The index is available.
  3. If I edit any field on PouchDB, Will that warm up the Index automatically.

Hi @maintainer, I would greatly appreciate it if you could take a look at this issue at your earliest convenience. The slow query performance is significantly impacting our application’s performance, and any guidance or suggestions would be immensely helpful. Thank you!

主要言語
JavaScript
スター
17.6k
フォーク
1.5k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/pouchdb のほかの issue

apache/pouchdb の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。