VLDB's own demo Greenplum MPP system is currently running v3.x of the Greenplum DBMS software, which we had planned to upgrade at some point soon. Pesky client projects always seem to get in the way ;-)Hang on a minute, we thought...we've got shiny new Apple MacBook Airs and Greenplum Community Edition (CE) v4 has just been released, so why not try Greenplum v4 out on Mac OSX. Why not indeed?Greenplum Community Edition (formerly Greenplum Single Node Edition, or SNE) info is here:http://www.greenplum.com/products/community-edition/Greenplum Community Edition v4 can be downloaded here:http://community.greenplum.com/The Greenplum CE v4 installation on OSX was carried out using the install guide, plus the following excellent topic on the Greenplum community forum:http://community.greenplum.com/forums/showthread.php?29-Installing-Greenplum-SNE-on-Mac-OS-X-10.5You will need both!Once installed, the Greenplum DBMS is started as usual in a terminal window on the Mac (snipped):gpdemo:~ gpadmin$ gpstart[INFO]:-Master Started...[INFO]:-Successfully started 2 of 2 segment instances[INFO]:-Starting Master instance gpdemo directory /gp/master/gp-1[INFO]:-Command pg_ctl reports Master gpdemo instance active[INFO]:-Database successfully started with no errors reported
The Postgres 'psql' SQL client connects to the 'gpperfmon' database interactively:
gpdemo:~ gpadmin$ psql gpperfmonpsql (8.2.14)Type "help" for help.To list the default databases installed:gpperfmon=# \lList of databasesName | Owner | Encoding----------+---------+----------gpperfmon | gpadmin | UTF8postgres | gpadmin | UTF8template0 | gpadmin | UTF8template1 | gpadmin | UTF8(4 rows)To list the tables installed in the 'gpperfmon' database (snipped):gpperfmon=# \dList of relationsSchema | Name | Type | Owner | Storage-------+--------------------------+-------+---------+----------public | _database_tail | table | gpadmin | externalpublic | _iterators_tail | table | gpadmin | externalpublic | _queries_tail | table | gpadmin | externalpublic | _segment_tail | table | gpadmin | externalpublic | _system_tail | table | gpadmin | externalpublic | database_history | table | gpadmin | heappublic | database_history_1_prt_1 | table | gpadmin | heappublic | master_data_dir | table | gpadmin | externalpublic | memory_info | view | gpadmin | nonepublic | queries_history | table | gpadmin | heappublic | queries_history_1_prt_1 | table | gpadmin | heappublic | system_now | table | gpadmin | externalpublic | system_tail | table | gpadmin | external(42 rows)To count the rows in a table:gpperfmon=# select count(*) from system_now;count-------1(1 row)
To count the rows in a table non-interactively, exit interactive psql using '\q' and run psql from the command prompt:
gpdemo:~ gpadmin$ psql gpperfmon -c 'select count(*) from system_now;'count-------1(1 row)
To run the same SQL from a shell script and send the output to a log file:
gpdemo:sql gpadmin$ more system_now.shpsql gpperfmon -f system_now.sql > system_now.log 2>&1gpdemo:sql gpadmin$ more system_now.sqlselect count(*) from system_now;gpdemo:sql gpadmin$ ./system_now.shgpdemo:sql gpadmin$ more system_now.logcount-------1(1 row)
The Postgres admin tool 'PGAdmin' was also downloaded, installed, configured and pointed at the newly-minted Greenplum Community Edition for OSX install.
Download PGAmin from here: http://www.pgadmin.org/download/
This took under 5 minutes from start to finish.