Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and use Greenplum open source column storage zedstore

2025-01-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces "how to install and use Greenplum open source column storage zedstore" related knowledge, in the actual case operation process, many people will encounter such a dilemma, then let the editor lead you to learn how to deal with these situations! I hope you can read it carefully and be able to achieve something!

Installation

Download the source code from Github. Just like ordinary PG, you can compile and install it.

[root@localhost postgres-zedstore] # / configure-- enable-debug-- with-python-- with-perl-- with-tcl-- with-gssapi-- with-pam-- with-openssl-- with-pam-- without-ldap-- with-libxml-- with-libxslt-- enable-dtrace-- enable-depend-- enable-cassert-- with-systemd CFLAGS= "- O0-DOPTIMIZER_DEBUG-G3-gdwarf-2"-- prefix=/appdb/zedstorechecking build system type... [root@localhost postgres-zedstore] # make-J4... [root@localhost postgres-zedstore] # make install...PostgreSQL installation complete.

Heap vs ZedStore

Create a user and initialize the database

[zedstore@localhost] $initdb-E utf8-D / data/zedstore/testdbThe files belonging to this database system will be owned by user "zedstore". This user must also own the server process.The database cluster will be initialized with locale "en_US.UTF-8" includes default text search configuration will be set to "english" .data page checksums are disabled.creating directory / data/zedstore/testdb. Okcreating subdirectories... Okselecting dynamic shared memory implementation... Posixselecting default max_connections... 100selecting default shared_buffers... 128MBselecting default timezone... PRCcreating configuration files... Okrunning bootstrap script... Okperforming post-bootstrap initialization... Oksyncing data to disk... Okinitdb: warning: enabling "trust" authentication for local connectionsYou can change this by editing pg_hba.conf or using the option-A, or--auth-local and-- auth-host, the next time you run initdb.Success. You can now start the database server using: pg_ctl-D / data/zedstore/testdb-l logfile start

Let's compare the performance differences between head am and zedstore

Heap

Testdb=# create table t_heap (id int,c1 int,c2 varchar (20)); CREATE TABLE testdb=# insert into t_heap select x journal c2'| x from generate_series (1pm 5000000) as x tert insert 0 5000000testdb=#

Execute query

Testdb=# explain analyze select avg (id), sum (C1), max (c2) from t_heap QUERY PLAN- -Finalize Aggregate (cost=69209.94..69209.95 rows=1 width=72) (actual time=964.313..964.314 rows=1 loops=1)-> Gather (cost=69209.71..69209.92) Rows=2 width=72) (actual time=963.978..966.938 rows=3 loops=1) Workers Planned: 2 Workers Launched: 2-> Partial Aggregate (cost=68209.71..68209.72 rows=1 width=72) (actual time=929.220..929.220 rows=1 loops=3)-> Parallel Seq Scan on t_heap (cost=0.00..52584.55 rows=2083355 width=17) (actual time=0.094..256.014 rows=1666667 loops=3) Planning Time: 17.157 ms Execution Time: 968.461 ms (8 rows) testdb=#

Execution time is 968ms

Space occupation

Testdb=# select pg_size_pretty (pg_table_size ('tweeheap')); pg_size_pretty-248MB (1 row)

ZedStore

Testdb=# create table t_zedstore (id int,c1 int,c2 varchar (20)) using zedstore;CREATE TABLE testdb=# insert into t_zedstore select x from generate_series (1m 5000000) as x tert insert 0 5000000testdb=# | | x Magneto insert c2' |

Execute query

Testdb=# explain analyze select avg (id), sum (C1), max (c2) from t_zedstore QUERY PLAN- -Finalize Aggregate (cost=24917.50..24917.51 rows=1 width=72) (actual time=1341.238..1341.239 rows=1 loops=1)-> Gather (cost=24917.27..24917) .48 rows=2 width=72) (actual time=1341.046..1343.387 rows=3 loops=1) Workers Planned: 2 Workers Launched: 2-> Partial Aggregate (cost=23917.27..23917.28 rows=1 width=72) (actual time=1328.432..1328.432 rows=1 loops=3)-> Parallel Seq Scan on t_zedstore (cost=0.00..18968.87 rows=659787 width=17) (actual time=0.702..837.075 rows=1666667 loops=3) Planning Time: 0.643 Ms Execution Time: 1343.612 ms (8 rows) testdb=#

The time to use zedstore is 1343ms, which is nearly 40% slower than that of heap.

Space occupation

Testdb=# select pg_size_pretty (pg_table_size ('tweezedstore')); pg_size_pretty-97 MB (1 row) testdb=#

However, with zedstore, the space consumption is only about 40% of the original.

This is the end of "how to install and use Greenplum open source column storage zedstore". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 261

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report