For whatever reason, PouchDB does not use indexes parts which are not defined in first position for sorting.
This means that an index on "document type / gpx id / time" would not be used to sort the trkpts for a given gpx id be time (worse than that, this does even raise an exception) and the sort is currently done by the components, for instance in gpx.tsx:
This is inefficient and slow when there are many track points and this must be optimized.
For whatever reason, PouchDB does *not* use indexes parts which are not defined in first position for sorting.
This means that an index on "document type / gpx id / time" would not be used to sort the trkpts for a given gpx id be time (worse than that, this does even raise an exception) and the sort is currently done by the components, for instance in gpx.tsx:
```
trkpts.sort((first: any, second: any) =>
first.trkpt.time.localeCompare(second.trkpt.time)
);
```
This is inefficient and slow when there are many track points and this must be optimized.
vdv
added this to the 22/11 milestone 2022-10-02 13:01:11 +00:00
An option would be to [use and abuse ids](https://pouchdb.com/2014/06/17/12-pro-tips-for-better-code-with-pouchdb.html) and consider using the [DocURI library](https://pouchdb.com/2014/06/17/12-pro-tips-for-better-code-with-pouchdb.html).
vdv
added this to the Use all the possibilities of the GPX format project 2022-10-03 07:02:38 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
For whatever reason, PouchDB does not use indexes parts which are not defined in first position for sorting.
This means that an index on "document type / gpx id / time" would not be used to sort the trkpts for a given gpx id be time (worse than that, this does even raise an exception) and the sort is currently done by the components, for instance in gpx.tsx:
This is inefficient and slow when there are many track points and this must be optimized.
An option would be to use and abuse ids and consider using the DocURI library.
Done