Vertica Blog

Vertica Blog

DBadmin

Hand writing the text: Helpful Tips

Forcing a Merge Join

The Vertica optimizer implements a join with one of the following algorithms: Merge join is used when projections of the joined tables are sorted on the join columns. Merge joins are faster and use less memory than hash joins. Hash join is used when projections of the joined tables are not already sorted on the...
Quick Tip - blue button

Displaying the Vertica Code Name

Every major release of Vertica has a code name. To find out the Vertica code name of your database, you can query the DC_STARTUPS Data Collector table. Example: Helpful Link: https://www.vertica.com/docs/latest/HTML/Content/Authoring/AdministratorsGuide/Monitoring/Vertica/QueryingDataCollectorTables.htm Have fun!
Vintage businessman concept pointing on the wall wearing futuristic helmet at office

Descending Sequences

The default increment for a Vertica sequence is 1. But you can also create a sequence that has a negative increment so that you can have a count down. Example: Helpful Links: https://www.vertica.com/docs/latest/HTML/Content/Authoring/AdministratorsGuide/Sequences/Sequences.htm https://www.vertica.com/docs/latest/HTML/Content/Authoring/SQLReferenceManual/Statements/CREATESEQUENCE.htm Have fun!
Helpful Tips message on post-it note

Display Session Sequence Cached Values Remaining

To optimize the performance of large INSERT SELECT and COPY operations, Vertica uses sequence caching. To allocate cache among the nodes in a cluster for a given sequence, Vertica uses the following process: By default, when a session begins, the cluster initiator node requests cache for itself and other nodes in the cluster. The initiator...
Calendar February 29 for Leap Year

Is This a Leap Year?

A Common Year in the Gregorian calendar has 365 days. A Leap Year, which has 366 days, occurs nearly every 4 years. One algorithm to determine if a year is a Common or a Leap Year is: I’d like to create a user-defined SQL function in Vertica that will let me know if the year...
Cupcakes with blue icing and lit birthday candles

How Old Am I (In Months)?

You are probably aware that Vertica has a built-in function named AGE_IN_YEARS. It returns the difference in years between two dates, expressed as an integer. Example: My son is turning 18 this year! I was curious to know how many months he’s been on the planet, so I figured that I could just multiply his...

Display the Vertica Process Memory Allocated

For common Vertica cluster configurations, there should be a single running Vertica process on each node. You can use the Linux ps command to determine the process ID of the Vertica process. Once you have the process ID, you can display the amount of memory that has been allocated to the Vertica process using the...

Display Database Statement Counts by Type

There are many types of statements that can be executed in Vertica. Examples include queries, DDL (Data Definition Language), and utility statements. To summarize all the types of statements being executed, you can query the QUERY_PROFILES system table. Example: I’d like to view a count of each statement type across my cluster since the first...
Hand writing the text: Helpful Tips

Use Time Series Analytics to Generate a List of Dates at a Specific Start Date

Time series analytics evaluate the values of a given set of variables over time and group those values into a window (based on a time interval) for analysis and aggregation. This feature comes in handy if I need to generate a list of dates using some interval, for example 1 MONTH. Example: But why did...

Truncating a Timestamp

The built-in Vertica function DATE_TRUNC truncates date and time values to the specified precision. The return value is the same data type as the input value. All fields that are less than the specified precision are set to 0, or to 1 for day and month. Example: So did the current Millennium begin on January...

Accept the EULA When Installing Vertica

After installing Vertica, you have to ACCEPT the EULA the first time you start admintools on any Vertica node. To avoid having to do that, you can accept the EULA during the install using the --accept-eula or –Y option! Example: Helpful Links: https://www.vertica.com/docs/latest/HTML/Content/Authoring/InstallationGuide/InstallingVertica/InstallVerticaScript.htm https://www.vertica.com/docs/latest/HTML/Content/Authoring/InstallationGuide/InstallingVertica/InstallingVerticaSilently.htm Have fun!

Fun April Fool’s Day Trick Using Directed Queries

Directed Queries in Vertica encapsulate information that the optimizer can use to create a query plan. Directed queries can serve the following goals: Preserve current query plans before a scheduled upgrade. In most instances, queries perform more efficiently after a Vertica upgrade. In the few cases where this is not so, you can use directed...