scratchpad:random_magic_spells
Differences
This shows you the differences between two versions of the page.
scratchpad:random_magic_spells [2017/03/16 09:11] – rjs7 | scratchpad:random_magic_spells [2022/02/10 13:34] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 228: | Line 228: | ||
netscape.security.PrivilegeManager.enablePrivilege(" | netscape.security.PrivilegeManager.enablePrivilege(" | ||
</ | </ | ||
+ | |||
+ | ====== Performance ====== | ||
+ | =====Preload Your database into RAM===== | ||
+ | Find your database' | ||
+ | < | ||
+ | psql -U evergreen -h localhost -d postgres -c " | ||
+ | </ | ||
+ | |||
+ | Then, as the root or postgres user, run the following commands | ||
+ | < | ||
+ | cd / | ||
+ | cat * > /dev/null | ||
+ | </ | ||
+ | |||
+ | Replace ${pgversion} with your PostgreSQL version number, ex. 9.5. Replace ${oid} with the number returned by the database query. | ||
====== Utility ====== | ====== Utility ====== | ||
Line 539: | Line 554: | ||
; | ; | ||
</ | </ | ||
+ | |||
+ | |||
+ | =====Show statistic usage on reports=== | ||
+ | |||
+ | <code sql> | ||
+ | select thecount.name, | ||
+ | reporter.template rt, | ||
+ | ( | ||
+ | select rtinner.name " | ||
+ | (select naming.name, | ||
+ | reporter.template naming , | ||
+ | reporter.template clones | ||
+ | where | ||
+ | clones.data=naming.data and | ||
+ | naming.folder in(select id from reporter.template_folder where owner= !!!REPLACE ME WITH OWNER ID!!! and shared and share_with=1) and | ||
+ | naming.owner= | ||
+ | group by 1 | ||
+ | ) rtinner | ||
+ | |||
+ | where rr.template = any((' | ||
+ | group by 1 | ||
+ | |||
+ | ) as thecount | ||
+ | where | ||
+ | thecount.name = rt.name and | ||
+ | rt.owner= | ||
+ | rt.folder in(select id from reporter.template_folder where owner= !!!REPLACE ME WITH OWNER ID!!! and shared and share_with=1) | ||
+ | order by 4 desc | ||
+ | |||
+ | </ | ||
+ | |||
+ | You will need to edit that query to look for reports owned by a particular actor.usr.id. Replace " | ||
====== Development ====== | ====== Development ====== |
scratchpad/random_magic_spells.1489669917.txt.gz · Last modified: 2022/02/10 13:33 (external edit)