Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: support schemas #5

Open
DKroot opened this issue Aug 21, 2018 · 0 comments
Open

Feature: support schemas #5

DKroot opened this issue Aug 21, 2018 · 0 comments

Comments

@DKroot
Copy link

DKroot commented Aug 21, 2018

It'd be nice to be able to limit cache clearing to a particular entity only in a particular schema.

Supporting query that includes schemas:

-- Cache, ordered by the number of buffers
SELECT pn.nspname AS schema, pc.relname, count(1) AS buffers, sum(pb.isdirty :: INT) AS dirty_pages
FROM pg_buffercache pb
JOIN pg_class pc ON pb.relfilenode = pg_relation_filenode(pc.oid) --
    AND pb.reldatabase IN(0,
                          (SELECT oid
                           FROM pg_database
                           WHERE datname = current_database()))
JOIN pg_namespace pn ON pn.oid = pc.relnamespace
GROUP BY pc.relname, pn.nspname
ORDER BY buffers DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant