Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow deletion (and insertion) of large number of elements #1820

Open
JonPichel opened this issue Nov 1, 2023 · 0 comments
Open

Slow deletion (and insertion) of large number of elements #1820

JonPichel opened this issue Nov 1, 2023 · 0 comments

Comments

@JonPichel
Copy link

JonPichel commented Nov 1, 2023

Hi, I have a store containing around 500000 rows. When I invoke this code:

 await db.dataRecords
    .where("filename")
    .anyOf(...filenames)
    .delete()

With filenames being just 1 filename of around 450000 elements, it takes around 4 minutes to complete the deletion.

This is the code of my database:

import Dexie, { Table } from "dexie"
import { DataRecord } from "src/asterix"

export interface DataRecordDB {
  filename: string
  record: DataRecord
}

export class AsterixDexie extends Dexie {
  dataRecords!: Table<DataRecordDB>

  constructor() {
    super("AsterixDB")
    this.version(1).stores({
      dataRecords: "++,filename,record.category,record.aircraftID",
    })
  }
}

const db = new AsterixDexie()

export default db

Is this just all the performance IndexedDB has to offer, or am I doing something wrong?

When I insert the 450 thousand elements of the file, the insertion also takes a lot of time (around 1 minute).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant