At our work, all our logs are stored in a postgres database. We don’t utilise fts, so if I want to find a log line that matches some text, I have to use LIKE or ILIKE. The problem is that searching like this does not utilise indexes unless you search for something like ‘sometext%’ which is rarely helpful. So unless I can specify a small timespam within which to search, the query takes very long.
At our work, all our logs are stored in a postgres database. We don’t utilise fts, so if I want to find a log line that matches some text, I have to use LIKE or ILIKE. The problem is that searching like this does not utilise indexes unless you search for something like ‘sometext%’ which is rarely helpful. So unless I can specify a small timespam within which to search, the query takes very long.
text logs should be only read by time. if you care about the content use metrics.
otherwise just save text files. grep is faster than any non-memory databse fts.
Yeah,
like
is the slowest possible way to do searches. Definitely would be worth looking at utilizing FTS features here.