This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.github.areguig.demo; | |
import net.sf.json.JSONException; | |
import net.sf.json.JSONObject; | |
import org.springframework.http.HttpEntity; | |
import org.springframework.http.HttpHeaders; | |
import org.springframework.http.HttpMethod; | |
import org.springframework.http.HttpStatus; | |
import org.springframework.http.MediaType; | |
import org.springframework.http.ResponseEntity; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0x91CCC50ed7518630872fFc5dA6d3b060881991f6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select relname,(n_dead_tup+n_live_tup) as estimated_total_rows, n_dead_tup as estimated_dead_rows, | |
seq_scan,idx_scan | |
from pg_catalog.pg_stat_all_tables | |
where n_dead_tup > 0 | |
-- and relname = '<TABLE_NAME>' | |
and schemaname='<SCHEMA_NAME>' | |
order by n_dead_tup desc; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select relname,(n_dead_tup+n_live_tup) as estimated_total_rows, n_dead_tup as estimated_dead_rows, | |
seq_scan,idx_scan | |
from pg_catalog.pg_stat_all_tables | |
where n_dead_tup > 0 | |
-- and relname = '<TABLE_NAME>' | |
and schemaname='<SCHEMA_NAME>' | |
order by n_dead_tup desc; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT relname, 100 * idx_scan / (seq_scan + idx_scan) percent_of_times_index_used, | |
n_live_tup rows_in_table | |
FROM pg_stat_user_tables | |
ORDER BY n_live_tup DESC; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT pg_terminate_backend(procpid); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT pg_cancel_backend(procpid); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select relname,last_vacuum, last_autovacuum, last_analyze, last_autoanalyze | |
from pg_stat_user_tables; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT now() - query_start as "runtime",client_addr, waiting, state, query | |
FROM pg_stat_activity | |
ORDER BY runtime DESC; |