www.bundesbrandschatzamt.de
Babblings about Systems Administration.

Vertica and Emacs

If you have paid attention to my other blog entries you have already figured that I am a fan of Literate Database Work as well as a user of Vertica. sql-mode and sql-interactive-mode are quite powerful. I combined them with yasnippet. The product is vertica-snippets - a package you can install via MELPA. If you are like me you probably have trouble remembering queries like

select
       qe.user_name,
       count(*)
from
            v_monitor.query_events   qe
       join v_monitor.query_requests qr
         on qr.transaction_id        = qe.transaction_id
        and qr.statement_id          = qe.statement_id
where
       qr.request_type                        = 'QUERY'
  and  qe.event_type                          = 'RLE_OVERRIDDEN'
  and  to_char(event_timestamp, 'YYYY-MM-DD') = '2018-02-01'
group by
       1
;

of course it is easier to switch sql-product to vertica and type:

rle_check_

and press TAB.

I am totally aware of the fact that the number of users using VERTICA and Emacs is pretty small - right now the package got downloaded 9 times. Nonetheless: If you think a query is missing feel free to send me a pull request.