Practice Vertica SQL: projections, segmentation, COPY, and a columnar query workflow.
Vertica is a columnar analytics database with a strong focus on projections and segmentation. This lab is install-based because the old community Docker image is no longer published under the vertica/vertica-ce name. It gives you the DDL, projection, and COPY patterns to run against a local Community Edition or a licensed Vertica instance.
- Install Vertica Community Edition (RPM/DEB) or start a licensed Vertica instance/VM.
- Create a database named
laband connect withvsql -h localhost -U dbadmin -d lab. - Run
examples/01_setup.sqlto create the schema and a projection. - Run
examples/02_queries.sqlto seed and query the data. - Use
EXPLAINto see which projection the optimizer chooses.
| Field | Value |
|---|---|
| Host | localhost |
| Port | 5433 |
| Database | lab |
| User | dbadmin |
| vsql | vsql -h localhost -U dbadmin -d lab |
| JDBC URL | jdbc:vertica://localhost:5433/lab |
| File | What it shows |
|---|---|
examples/01_setup.sql |
Schema, table, and an explicit projection. |
examples/02_queries.sql |
Seed data, aggregation, and EXPLAIN. |
- Create a second projection sorted by
sold_atand compare plans for a date-range query. - Load a CSV with
COPY lab.sales FROM LOCAL '...' DELIMITER ','. - Add a segmentation expression and explain when it helps a join.
- Use
PROJECTION_COLUMNSto inspect column encoding.
- The historical
vertica/vertica-ceDocker image is no longer available on Docker Hub under that name; this lab does not depend on it. - Vertica Community Edition has a data-size limit. Check the current license terms before loading a large dataset.
- Projections are the physical design unit in Vertica; a table can have several.
SELECT REFRESH('')refreshes all projections; in a real deployment you would scope it.
This lab already runs in the provider's cloud. To use it from another country safely:
- Keep the account behind MFA and restrict network access to your IP or VPN where the provider allows it.
- Use a dedicated lab user with the minimum privileges; never reuse personal credentials.
- Store tokens and passwords in a secret manager or environment variables, never in the repository.
- Stop or delete the warehouse, cluster, or VM when you finish to control cost.
The shared checklist and provider map are in REMOTE-ACCESS.md.
Part of the database-labs collection: 26 database engines, one index.
MIT (c) 2026 Arya Fatthurahman. See LICENSE.