Quick GPDB Questions

63 views
Skip to first unread message

A Naveen Marshal

unread,
Nov 17, 2017, 10:54:56 AM11/17/17
to gpdb-...@greenplum.org

1. Is there way to list out tables which are not frequently used. (hard way is to figure out from physical files last modified date).

2. Is there way to get a memory utilized by a query, during run time ( means any catalog table to fetch for value) i don't want to look for explain analyze.

Thanks,
NM

Luis Macedo

unread,
Nov 17, 2017, 12:45:57 PM11/17/17
to A Naveen Marshal, Greenplum Users
1- no unless you parse the query log files/tables.

2- there are views that monitor spill files which will be more important than monitoring memory which will be limited by statement men.

--- Sent from my Google Pixel

--
You received this message because you are subscribed to the Google Groups "Greenplum Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gpdb-users+unsubscribe@greenplum.org.
To post to this group, send email to gpdb-...@greenplum.org.
Visit this group at https://groups.google.com/a/greenplum.org/group/gpdb-users/.
For more options, visit https://groups.google.com/a/greenplum.org/d/optout.

Jon Roberts

unread,
Nov 17, 2017, 12:58:30 PM11/17/17
to Luis Macedo, A Naveen Marshal, Greenplum Users
Additionally, the data disks should be mounted with "noatime" which prevents the operating system from updating the time on files when read.  This improves I/O performance.  So you won't be able to look at the dates of the files to determine if the tables are in use or not.



Jon Roberts

akha...@pivotal.io

unread,
Nov 17, 2017, 8:56:08 PM11/17/17
to Greenplum Users, lma...@pivotal.io, naveen.m...@gmail.com
Hi NM,

1. Is there way to list out tables which are not frequently used. (hard way is to figure out from physical files last modified date).

2. Is there way to get a memory utilized by a query, during run time ( means any catalog table to fetch for value) i don't want to look for explain analyze.
Have you seen this?
Viewing Session Memory Usage Information
You can create and use the session_level_memory_consumption view that provides information about the current memory utilization for sessions that are running queries on Greenplum Database. The view contains session information and information such as the database that the session is connected to, the query that the session is currently running, and memory consumed by the session processes.

Also, not sure of your use case, but have you looked into the below GPDB features to manage this?

Resource queues (old) and resource groups (new):

Vmem protector:

Amil

Heikki Linnakangas

unread,
Nov 20, 2017, 10:56:15 AM11/20/17
to akha...@pivotal.io, Greenplum Users, lma...@pivotal.io, naveen.m...@gmail.com
On 11/18/2017 03:56 AM, akha...@pivotal.io wrote:
> Hi NM,
>
> 1. Is there way to list out tables which are not frequently used. (hard way
>> is to figure out from physical files last modified date).
>
> I don't know the definite answer, but here is some info I found which may
> be useful:
> https://dba.stackexchange.com/questions/58214/getting-last-modification-date-of-a-postgresql-database-table
> https://stackoverflow.com/questions/899203/how-do-i-find-the-last-time-that-a-postgresql-database-has-been-updated

On PostgreSQL you can indeed use the pg_stat_user_tables view, and look
at the number of heap and index scans. Unfortunately, the view doesn't
work on GPDB as you might expect: it shows the stats on the master node,
which are always 0, because all the data is stored on the segments. So
you'll need to somehow obtain those numbers from the segments, instead.
One option is to connect to each segment in "utility mode", and run
"select * from pg_user_tables" there.

- Heikki

Luis Macedo

unread,
Nov 20, 2017, 11:08:50 AM11/20/17
to Heikki Linnakangas, akha...@pivotal.io, Greenplum Users, A Naveen Marshal
Heikki,

That is a common request from users, should we think about adding this feature to GPDB on the data dictionary on the master? How hard would it be to implement the collection of this stats from segments into the master?


Rgds,

Luis Macedo | Sr Platform Architect | Pivotal Inc 

Call Me @ +55 11 97616-6438

Heikki Linnakangas

unread,
Nov 20, 2017, 11:11:16 AM11/20/17
to Luis Macedo, akha...@pivotal.io, Greenplum Users, A Naveen Marshal
On 11/20/2017 06:08 PM, Luis Macedo wrote:
> Heikki,
>
> That is a common request from users, should we think about adding this
> feature to GPDB on the data dictionary on the master?

Yeah, IMHO we really should. The pg_stat views are pretty useless as
they are now.

> How hard would it be to implement the collection of this stats from
> segments into the master?
Shouldn't be hard. With the new EXECUTE ON SEGMENTS/MASTER syntax in
CREATE FUNCTION, in GPDB6, it might be a one-line change, to mark the
functions backing the pg_stat views as EXECUTE ON SEGMENTS.

- Heikki

Luis Macedo

unread,
Nov 20, 2017, 11:37:19 AM11/20/17
to Heikki Linnakangas, akha...@pivotal.io, Greenplum Users, A Naveen Marshal
Nice! 

BTW did I mention that you guys on engineering are rocking! :)



Luis Macedo | Sr Platform Architect | Pivotal Inc 

Call Me @ +55 11 97616-6438


A Naveen Marshal

unread,
Nov 20, 2017, 12:00:04 PM11/20/17
to Luis Macedo, Heikki Linnakangas, akha...@pivotal.io, Greenplum Users
Hi All,

Thanks for suggestions. 

Thanks to ENG Team.

Regards,
NM
Reply all
Reply to author
Forward
0 new messages