You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While analyzing queries' performance, it can be seen that the ordering part of the query induces a relatively high cost.
For example, the following command...
EXPLAIN SELECT messageHash, pubsubTopic, contentTopic, payload, version, timestamp, meta FROM messages WHERE (timestamp, messageHash) < ('1720302271182353364','45556c0703060705c99b1aef6664016d5e56813d3729fa3da3ee8eb50db90b96') AND contentTopic IN ('/waku/1/0xc95d2429/rfc26','/waku/1/0xab62afd0/rfc26','/waku/1/0xb6368e8a/rfc26','/waku/1/0xdadfdbfa/rfc26','/waku/1/0x89bed93d/rfc26','/waku/1/0xa0a6b41b/rfc26','/waku/1/0xd811cd50/rfc26','my-ctopic-2','/waku/1/0x242ed557/rfc26') AND pubsubTopic = '/waku/2/rs/16/32' AND timestamp >= '1720245600080250079' AND timestamp <= '1720863401735745080' ORDER BY timestamp DESC, messageHash DESC LIMIT '20';
... gives the following results:
On the other hand, if we skip the ORDER BY statements, then the following command ...
EXPLAIN SELECT messageHash, pubsubTopic, contentTopic, payload, version, timestamp, meta FROM messages WHERE (timestamp, messageHash) < ('1720302271182353364','45556c0703060705c99b1aef6664016d5e56813d3729fa3da3ee8eb50db90b96') AND contentTopic IN ('/waku/1/0xc95d2429/rfc26','/waku/1/0xab62afd0/rfc26','/waku/1/0xb6368e8a/rfc26','/waku/1/0xdadfdbfa/rfc26','/waku/1/0x89bed93d/rfc26','/waku/1/0xa0a6b41b/rfc26','/waku/1/0xd811cd50/rfc26','my-ctopic-2','/waku/1/0x242ed557/rfc26') AND pubsubTopic = '/waku/2/rs/16/32' AND timestamp >= '1720245600080250079' AND timestamp <= '1720863401735745080' LIMIT '20';
... gives the following results:
I think we can avoid ordering in the database and instead, perform the desired ordering in nwaku code base.
The text was updated successfully, but these errors were encountered:
Background
While analyzing queries' performance, it can be seen that the ordering part of the query induces a relatively high cost.
For example, the following command...
... gives the following results:
On the other hand, if we skip the
ORDER BY
statements, then the following command ...... gives the following results:
I think we can avoid ordering in the database and instead, perform the desired ordering in
nwaku
code base.The text was updated successfully, but these errors were encountered: