replxx requires each history line to prepended with time line:
### YYYY-MM-DD HH:MM:SS.SSS
select 1
And w/o those service lines it will load all lines from history file as
one history line for suggestion. And if there are lots of lines in file it
will take lots of time (getline() + tons of reallocations).
- By default M-BACKSPACE is KILL_TO_WHITESPACE_ON_LEFT, while in
readline it is backward-kill-word, so use KILL_TO_BEGINING_OF_WORD
instead.
- By default C-w is KILL_TO_BEGINING_OF_WORD, while in readline it is
unix-word-rubout, so use KILL_TO_WHITESPACE_ON_LEFT instead.
This replxx object is pretty heavy and in debug build may slow down [1]
(although I cannot confirm 0.5s delay for each query in debug build) the
client and besides it is not required since ClickHouse-Extras/replxx#10,
which changes the behaviour of history_save(), and now it will not
update current session anymore, only save the history to the disk.
[1]: https://github.com/ClickHouse/ClickHouse/pull/13086#issuecomment-667719026
By default replxx reload history from the file in
replxx::Replxx::history_save(), and this will overlaps current session
history with the history from other sessions, and this does not looks a
great idea (bash and other interpreters don't do this).
So to avoid this, use separate replxx::Replxx instance.
It is not easy to keep in mind that C-p/C-n is not
history-previous/history-next in replxx, thus it is pretty easy to
mistype.
Previous COMPLETE_NEXT/COMPLETE_PREV bindings has been binded to the
M-P/M-N (that was used for HISTORY_COMMON_PREFIX_SEARCH before, but it
also binded to M-p/M-n).
Plus clickhouse-client can be compiled with readline, so it is better to
make bindings the same.