Both great suggestions, thanks
At back of my mind was something like a library that could warn if an index wasn’t being used, or partially used
Oh, you can run a SQL query for that. I'm sure you could adapt this to run within your application, to give you some insight...
SELECT s.schemaname,
s.relname AS tablename,
s.indexrelname AS indexname,
pg_size_pretty(pg_relation_size(s.indexrelid)) AS index_size,
idx_scan as index_scans
FROM pg_catalog.pg_stat_user_indexes s
JOIN pg_catalog.pg_index i ON s.indexrelid = i.indexrelid
WHERE s.idx_scan = 0 -- has never been scanned
AND 0 <>ALL (i.indkey) -- no index column is an expression
AND pg_relation_size(relid) > 5 * 8192 -- has some data in the table
AND NOT i.indisunique -- is not a UNIQUE index
AND NOT EXISTS -- does not enforce a constraint
(SELECT 1 FROM pg_catalog.pg_constraint c
WHERE c.conindid = s.indexrelid)
AND s.schemaname = 'REPLACE_ME_WITH_YOUR_SCHEMA_NAME'
ORDER BY pg_relation_size(s.indexrelid) / nullif(idx_scan, 0) DESC NULLS FIRST,
pg_relation_size(i.indexrelid) DESC;
Hello, does anybody have clojure library recommendation to generate reports like invoice and db data?
@raefaldhiamartya do you mean generate PDF or ...? and db data is a pretty general term? could you clarify your requirements?
yes a PDF. I want to export table of users info (email, fullname, ...) from db to pdf
<https://github.com/clj-pdf/clj-pdf>
?
There are numerous libraries that can be used to query the database, with my particular favourites being next.jdbc with honeysql.
You could also generate asciidoc or HTML and then generate the PDF from that.
okayy, thank you!
@raefaldhiamartya I've used clj-pdf at work before. it is quite simple to use and has a good performance. prior to that we generated a html then used a shell command to generate the pdf, doing everything inside clojure scaled better for our use case. (this might be an useful information depending on what you're trying to do)
@raefaldhiamartya I once wrote a report generator that created markdown which I sent through pandoc to generate a pdf. Worked really well.
they don't have a dmg yet, just a zip..
so had to set JAVA_HOME in my shell and my Emacs
@kbsant That's what I do with GraalVM all the time. I don't use any installers, just download the gzip, unpack it in my Downloads and it sits there for about half a year until the nnext version
@borkdude thats nice and clean, just discovered it now that a dmg was unavailable. so far tools work fine, so i'll stick to tar.gz
https://notamonadtutorial.com/rebuilding-the-racket-compiler-with-chez-scheme-210e23a69484 Not specifically Clojure, but the Racket team ported it’s compiler from C to Chez Scheme. With some coworkers, we interviewed Matthew Flatt & Gustavo Massaccesi that took part of that effort.
Btw I'm maintaining homebrew cask for graalvm https://github.com/DeLaGuardo/homebrew-graalvm
brew tap DeLaGuardo/graalvm
and then
brew search graalvm
it should give you all available versions
nice!