| <!-- HTML header for doxygen 1.8.4--> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| <meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| <meta name="generator" content="Doxygen 1.8.10"/> |
| <meta name="keywords" content="madlib,postgres,greenplum,machine learning,data mining,deep learning,ensemble methods,data science,market basket analysis,affinity analysis,pca,lda,regression,elastic net,huber white,proportional hazards,k-means,latent dirichlet allocation,bayes,support vector machines,svm"/> |
| <title>MADlib: Profile</title> |
| <link href="tabs.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="jquery.js"></script> |
| <script type="text/javascript" src="dynsections.js"></script> |
| <link href="navtree.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="resize.js"></script> |
| <script type="text/javascript" src="navtreedata.js"></script> |
| <script type="text/javascript" src="navtree.js"></script> |
| <script type="text/javascript"> |
| $(document).ready(initResizable); |
| $(window).load(resizeHeight); |
| </script> |
| <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="search/searchdata.js"></script> |
| <script type="text/javascript" src="search/search.js"></script> |
| <script type="text/javascript"> |
| $(document).ready(function() { init_search(); }); |
| </script> |
| <!-- hack in the navigation tree --> |
| <script type="text/javascript" src="eigen_navtree_hacks.js"></script> |
| <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| <link href="madlib_extra.css" rel="stylesheet" type="text/css"/> |
| <!-- google analytics --> |
| <script> |
| (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ |
| (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
| m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
| })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); |
| ga('create', 'UA-45382226-1', 'madlib.net'); |
| ga('send', 'pageview'); |
| </script> |
| </head> |
| <body> |
| <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| <div id="titlearea"> |
| <table cellspacing="0" cellpadding="0"> |
| <tbody> |
| <tr style="height: 56px;"> |
| <td id="projectlogo"><a href="http://madlib.net"><img alt="Logo" src="madlib.png" height="50" style="padding-left:0.5em;" border="0"/ ></a></td> |
| <td style="padding-left: 0.5em;"> |
| <div id="projectname"> |
| <span id="projectnumber">1.9</span> |
| </div> |
| <div id="projectbrief">User Documentation for MADlib</div> |
| </td> |
| <td> <div id="MSearchBox" class="MSearchBoxInactive"> |
| <span class="left"> |
| <img id="MSearchSelect" src="search/mag_sel.png" |
| onmouseover="return searchBox.OnSearchSelectShow()" |
| onmouseout="return searchBox.OnSearchSelectHide()" |
| alt=""/> |
| <input type="text" id="MSearchField" value="Search" accesskey="S" |
| onfocus="searchBox.OnSearchFieldFocus(true)" |
| onblur="searchBox.OnSearchFieldFocus(false)" |
| onkeyup="searchBox.OnSearchFieldChange(event)"/> |
| </span><span class="right"> |
| <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> |
| </span> |
| </div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <!-- end header part --> |
| <!-- Generated by Doxygen 1.8.10 --> |
| <script type="text/javascript"> |
| var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| </script> |
| </div><!-- top --> |
| <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| <div id="nav-tree"> |
| <div id="nav-tree-contents"> |
| <div id="nav-sync" class="sync"></div> |
| </div> |
| </div> |
| <div id="splitbar" style="-moz-user-select:none;" |
| class="ui-resizable-handle"> |
| </div> |
| </div> |
| <script type="text/javascript"> |
| $(document).ready(function(){initNavTree('group__grp__profile.html','');}); |
| </script> |
| <div id="doc-content"> |
| <!-- window showing the filter options --> |
| <div id="MSearchSelectWindow" |
| onmouseover="return searchBox.OnSearchSelectShow()" |
| onmouseout="return searchBox.OnSearchSelectHide()" |
| onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| </div> |
| |
| <!-- iframe showing the search results (closed by default) --> |
| <div id="MSearchResultsWindow"> |
| <iframe src="javascript:void(0)" frameborder="0" |
| name="MSearchResults" id="MSearchResults"> |
| </iframe> |
| </div> |
| |
| <div class="header"> |
| <div class="headertitle"> |
| <div class="title">Profile<div class="ingroups"><a class="el" href="group__grp__deprecated.html">Deprecated Modules</a></div></div> </div> |
| </div><!--header--> |
| <div class="contents"> |
| <dl class="section warning"><dt>Warning</dt><dd><em> This is an old implementation of summary function. Replacement of this function is available as the Summary module <a class="el" href="group__grp__summary.html">Summary</a></em></dd></dl> |
| <div class="toc"><b>Contents</b> </p><ul> |
| <li> |
| <a href="#syntax">Function Syntax</a> </li> |
| <li> |
| <a href="#examples">Examples</a> </li> |
| <li> |
| <a href="#notes">Implementation Notes</a> </li> |
| <li> |
| <a href="#related">Related Topics</a> </li> |
| </ul> |
| </div><p>This module computes a "profile" of a table or view: a predefined set of aggregates to be run on each column of a table.</p> |
| <p>The following aggregates are called on every integer column:</p><ul> |
| <li>min(), max(), <a class="el" href="linalg_8sql__in.html#a1aa37f73fb1cd8d7d106aa518dd8c0b4" title="Compute the average of vectors. ">avg()</a></li> |
| <li>madlib.cmsketch_median()</li> |
| <li>madlib.cmsketch_depth_histogram()</li> |
| <li>madlib.cmsketch_width_histogram()</li> |
| </ul> |
| <p>The following aggregates are called on non-integer columns:</p><ul> |
| <li>madlib.fmsketch_dcount()</li> |
| <li>madlib.mfvsketch_quick_histogram()</li> |
| <li>madlib.mfvsketch_top_histogram()</li> |
| </ul> |
| <p>Because the input schema of the table or view is unknown, SQL is synthesized to suit the input. This is done either via the <code>profile</code> or <code>profile_full</code> user defined function.</p> |
| <p><a class="anchor" id="syntax"></a></p><dl class="section user"><dt>Function Syntax</dt><dd></dd></dl> |
| <p>Generate basic profile information (subset of predefined aggregate functions) for all columns of the input table. </p><pre class="syntax"> |
| profile( input_table ) |
| </pre><p>Generate full profile information (all predefined aggregate functions) for all columns of the input table. </p><pre class="syntax"> |
| profile_full( input_table, |
| buckets |
| ) |
| </pre><p><a class="anchor" id="examples"></a></p><dl class="section user"><dt>Examples</dt><dd></dd></dl> |
| <ol type="1"> |
| <li>Generate basic profile information. <pre class="example"> |
| SELECT * FROM profile( 'pg_catalog.pg_tables'); |
| </pre> Result: <pre class="result"> |
| schema_name | table_name | column_name | function | value |
|  ------------+------------+-------------+-------------------+------- |
| pg_catalog | pg_tables | * | COUNT() | 105 |
| pg_catalog | pg_tables | schemaname | <a class="el" href="sketch_8sql__in.html#ae27d5aaa5e4b426bcfe55e05a89c8e0b" title="Flajolet-Martin's distinct count estimation. ">fmsketch_dcount()</a> | 6 |
| pg_catalog | pg_tables | tablename | <a class="el" href="sketch_8sql__in.html#ae27d5aaa5e4b426bcfe55e05a89c8e0b" title="Flajolet-Martin's distinct count estimation. ">fmsketch_dcount()</a> | 104 |
| pg_catalog | pg_tables | tableowner | <a class="el" href="sketch_8sql__in.html#ae27d5aaa5e4b426bcfe55e05a89c8e0b" title="Flajolet-Martin's distinct count estimation. ">fmsketch_dcount()</a> | 2 |
| pg_catalog | pg_tables | tablespace | <a class="el" href="sketch_8sql__in.html#ae27d5aaa5e4b426bcfe55e05a89c8e0b" title="Flajolet-Martin's distinct count estimation. ">fmsketch_dcount()</a> | 1 |
| pg_catalog | pg_tables | hasindexes | <a class="el" href="sketch_8sql__in.html#ae27d5aaa5e4b426bcfe55e05a89c8e0b" title="Flajolet-Martin's distinct count estimation. ">fmsketch_dcount()</a> | 2 |
| pg_catalog | pg_tables | hasrules | <a class="el" href="sketch_8sql__in.html#ae27d5aaa5e4b426bcfe55e05a89c8e0b" title="Flajolet-Martin's distinct count estimation. ">fmsketch_dcount()</a> | 1 |
| pg_catalog | pg_tables | hastriggers | <a class="el" href="sketch_8sql__in.html#ae27d5aaa5e4b426bcfe55e05a89c8e0b" title="Flajolet-Martin's distinct count estimation. ">fmsketch_dcount()</a> | 2 |
| (8 rows) |
| </pre></li> |
| <li>Generate full profile information. <pre class="example"> |
| SELECT * FROM profile_full( 'pg_catalog.pg_tables', |
| 5 |
| ); |
| </pre> Result: <pre class="result"> |
| schema_name | table_name | column_name | function | value |
|  ------------+------------+-------------+-------------------------------------------------+---------------------------------------------------------------------------------------------------- |
| pg_catalog | pg_tables | * | COUNT() | 105 |
| pg_catalog | pg_tables | schemaname | <a class="el" href="sketch_8sql__in.html#ae27d5aaa5e4b426bcfe55e05a89c8e0b" title="Flajolet-Martin's distinct count estimation. ">fmsketch_dcount()</a> | 6 |
| pg_catalog | pg_tables | schemaname | array_collapse(mfvsketch_quick_histogram((),5)) | [0:4]={pg_catalog:68,public:19,information_schema:7,gp_toolkit:5,maddy:5} |
| pg_catalog | pg_tables | schemaname | array_collapse(mfvsketch_top_histogram((),5)) | [0:4]={pg_catalog:68,public:19,information_schema:7,gp_toolkit:5,maddy:5} |
| pg_catalog | pg_tables | tablename | <a class="el" href="sketch_8sql__in.html#ae27d5aaa5e4b426bcfe55e05a89c8e0b" title="Flajolet-Martin's distinct count estimation. ">fmsketch_dcount()</a> | 104 |
| pg_catalog | pg_tables | tablename | array_collapse(mfvsketch_quick_histogram((),5)) | [0:4]={migrationhistory:2,pg_statistic:1,sql_features:1,sql_implementation_info:1,sql_languages:1} |
| pg_catalog | pg_tables | tablename | array_collapse(mfvsketch_top_histogram((),5)) | [0:4]={migrationhistory:2,pg_statistic:1,sql_features:1,sql_implementation_info:1,sql_languages:1} |
| pg_catalog | pg_tables | tableowner | <a class="el" href="sketch_8sql__in.html#ae27d5aaa5e4b426bcfe55e05a89c8e0b" title="Flajolet-Martin's distinct count estimation. ">fmsketch_dcount()</a> | 2 |
| pg_catalog | pg_tables | tableowner | array_collapse(mfvsketch_quick_histogram((),5)) | [0:1]={agorajek:104,alex:1} |
| pg_catalog | pg_tables | tableowner | array_collapse(mfvsketch_top_histogram((),5)) | [0:1]={agorajek:104,alex:1} |
| pg_catalog | pg_tables | tablespace | <a class="el" href="sketch_8sql__in.html#ae27d5aaa5e4b426bcfe55e05a89c8e0b" title="Flajolet-Martin's distinct count estimation. ">fmsketch_dcount()</a> | 1 |
| pg_catalog | pg_tables | tablespace | array_collapse(mfvsketch_quick_histogram((),5)) | [0:0]={pg_global:28} |
| pg_catalog | pg_tables | tablespace | array_collapse(mfvsketch_top_histogram((),5)) | [0:0]={pg_global:28} |
| pg_catalog | pg_tables | hasindexes | <a class="el" href="sketch_8sql__in.html#ae27d5aaa5e4b426bcfe55e05a89c8e0b" title="Flajolet-Martin's distinct count estimation. ">fmsketch_dcount()</a> | 2 |
| pg_catalog | pg_tables | hasindexes | array_collapse(mfvsketch_quick_histogram((),5)) | [0:1]={t:59,f:46} |
| pg_catalog | pg_tables | hasindexes | array_collapse(mfvsketch_top_histogram((),5)) | [0:1]={t:59,f:46} |
| pg_catalog | pg_tables | hasrules | <a class="el" href="sketch_8sql__in.html#ae27d5aaa5e4b426bcfe55e05a89c8e0b" title="Flajolet-Martin's distinct count estimation. ">fmsketch_dcount()</a> | 1 |
| pg_catalog | pg_tables | hasrules | array_collapse(mfvsketch_quick_histogram((),5)) | [0:0]={f:105} |
| pg_catalog | pg_tables | hasrules | array_collapse(mfvsketch_top_histogram((),5)) | [0:0]={f:105} |
| pg_catalog | pg_tables | hastriggers | <a class="el" href="sketch_8sql__in.html#ae27d5aaa5e4b426bcfe55e05a89c8e0b" title="Flajolet-Martin's distinct count estimation. ">fmsketch_dcount()</a> | 2 |
| pg_catalog | pg_tables | hastriggers | array_collapse(mfvsketch_quick_histogram((),5)) | [0:1]={f:102,t:3} |
| pg_catalog | pg_tables | hastriggers | array_collapse(mfvsketch_top_histogram((),5)) | [0:1]={f:102,t:3} |
| (22 rows) |
| </pre></li> |
| </ol> |
| <p><a class="anchor" id="notes"></a></p><dl class="section user"><dt>Implementation Notes</dt><dd></dd></dl> |
| <p>Because some of the aggregate functions used in profile return multi-dimensional arrays, which are not easily handled in pl/python, we are using <code>array_collapse</code> function to collaps the n-dim arrays to 1-dim arrays. All values of 2 and upper dimensions are separated with ':' character.</p> |
| <p>Note that this module is not available in HAWQ. Instead, we suggest the Summary module in Descriptive Statistics as a replacement of this module.</p> |
| <p><a class="anchor" id="related"></a></p><dl class="section user"><dt>Related Topics</dt><dd>File <a class="el" href="profile_8sql__in.html" title="SQL function for single-pass table profiles. ">profile.sql_in</a> documenting SQL functions. </dd></dl> |
| </div><!-- contents --> |
| </div><!-- doc-content --> |
| <!-- start footer part --> |
| <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| <ul> |
| <li class="footer">Generated on Thu Apr 7 2016 14:24:11 for MADlib by |
| <a href="http://www.doxygen.org/index.html"> |
| <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.10 </li> |
| </ul> |
| </div> |
| </body> |
| </html> |