{"id":1959,"date":"2020-05-17T13:15:59","date_gmt":"2020-05-17T13:15:59","guid":{"rendered":"http:\/\/www.theSQLReport.com\/?p=1959"},"modified":"2020-05-17T13:15:59","modified_gmt":"2020-05-17T13:15:59","slug":"teradata-most-currently-updated-stats","status":"publish","type":"post","link":"https:\/\/www.theSQLReport.com\/?p=1959","title":{"rendered":"Teradata &#8211; Most Currently Updated Stats"},"content":{"rendered":"<p>This is a quick query that I use to check if the on the stats job that ran over night.\u00a0 Much faster then running the &#8220;SHOW STATISTICS&#8221; for each table.<\/p>\n<pre>select \r\nDatabaseName, \r\nTableName, \r\nColumnName, \r\nRowCount, \r\nLastCollectTimeStamp AT 'America Eastern' AS LastCollectTimeStamp, \r\nSampleSizePct\r\nfrom DBC.TableStatsV\r\nwhere LastCollectTimeStamp &gt; DATE - 1\r\nAND DatabaseName not in ('DBC')\r\norder by LastCollectTimeStamp;<\/pre>\n<div id=\"attachment_1960\" style=\"width: 621px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2020\/05\/Teradata_Last_Stats_Collected.jpg\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1960\" class=\"wp-image-1960 size-full\" src=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2020\/05\/Teradata_Last_Stats_Collected.jpg\" alt=\"Stats that were last ran\" width=\"611\" height=\"278\" \/><\/a><p id=\"caption-attachment-1960\" class=\"wp-caption-text\">Works in Teradata Express too.<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This is a quick query that I use to check if the on the stats job that ran over night.\u00a0 Much faster then running the &#8220;SHOW STATISTICS&#8221; for each table. &hellip; <a class=\"readmore\" href=\"https:\/\/www.theSQLReport.com\/?p=1959\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":1960,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[54],"tags":[184,58,183],"class_list":["post-1959","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-teradata","tag-last-updated","tag-query","tag-statistics"],"_links":{"self":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1959"}],"collection":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1959"}],"version-history":[{"count":2,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1959\/revisions"}],"predecessor-version":[{"id":1962,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1959\/revisions\/1962"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/media\/1960"}],"wp:attachment":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}