GSP1087 - Accelerating Analytical Queries using the AlloyDB Columnar Engine
Navigation menu > Databases > AlloyDB for PostgreSQL > Clusters
Copy ip address of the cluster 10.25.0.2
Navigation menu > Compute Engine > VM Instances
Connect SSH to the instance
Set environment variables
export ALLOYDB=ALLOYDB_ADDRESS
Simpan ke AlloyDB
echo $ALLOYDB > alloydbip.txt
pgbench
pgbench -h $ALLOYDB -U postgres -i -s 500 -F 90 -n postgres
Connect to AlloyDB
psql -h $ALLOYDB -U postgres
View table
select count (* ) from pgbench_accounts;
Task 2. Run a Baseline Test
Hidupkan timer
Run query
SELECT aid, bid, abalance FROM pgbench_accounts WHERE bid < 189 OR abalance > 100 LIMIT 20 ;
EXPLAIN (ANALYZE,COSTS,SETTINGS,BUFFERS,TIMING,SUMMARY,WAL,VERBOSE)
SELECT count (* ) FROM pgbench_accounts WHERE bid < 189 OR abalance > 100 ;
Task 3. Verify the Database Flag for the Columnar Engine
Navigation menu > Databases > AlloyDB for PostgreSQL > Clusters > lab-instance > Edit Primary > Add Flag
Task 4. Set or Verify a Database Extension for the Columnar Engine
Cek koneksi
Cek extension
Task 5. Testing the Columnar Engine
Add pgbench_accounts table to the columnar engine
SELECT google_columnar_engine_add(' pgbench_accounts' );