Return mimetype with relation
ClosedPublic

Authored by knauss on Nov 27 2015, 4:09 PM.

Details

Summary

potential performance impact because we fetch every item for each
relation, let's hope the caching fixes that.

notes from randa:

  • Get mimetype id as part of relationquery.
  • Lookup mimetype name in local cache.

-> at them moment the mimtype as string is used as argument and also transfered
-> till what point i should use the id, and where to transform to the name?

  • Port to new protocol.

-> should be done

Diff Detail

Repository
R165 Akonadi
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
knauss updated this revision to Diff 1399.Nov 27 2015, 4:09 PM
knauss retitled this revision from to Return mimetype with relation.
knauss updated this object.
knauss edited the test plan for this revision. (Show Details)
knauss added a reviewer: dvratil.
dvratil edited edge metadata.Dec 5 2015, 6:32 PM

The mimetypes should be transmitted in FetchRelationsCommand as QByteArrays, not qint64s, then the server should resolve the mimetypes into IDs to be used as part of the SQL query (mimetypes will always hit the in-memory cache, so no performance problem there). You don't have to worry about transmitting an empty QByteArray being a waste of resources, as a matter of fact it's more effective than transmitting a null qint64 :)

Note that you also need to adjust FetchRelationsResponse to hold the mimetypes, again using QByteArrays there is OK.

src/private/protocol.cpp
2592

Please adjust the debug string as well

knauss updated this revision to Diff 2785.Mar 15 2016, 4:28 PM
knauss marked an inline comment as done.
knauss edited edge metadata.

Updated with Daniel comments + fixed tests.

Restricted Application added a project: KDE PIM. · View Herald TranscriptMar 15 2016, 4:28 PM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript

This changes protocol interface, please bump the number in Protocol::version() and adjust ProtocolTest::testProtocolVersion() accordingly (you can ignore the comment in the function, we don't have a test for Relations yet :)

dvratil accepted this revision.Mar 16 2016, 12:05 PM
dvratil edited edge metadata.
This revision is now accepted and ready to land.Mar 16 2016, 12:05 PM
This revision was automatically updated to reflect the committed changes.