Avatar
mrkrd
b5af8993ed867fca6df7a90d7b6a5e966c2316f3bbf0228c58c36bb1894230f7
Data & IT #postgres #sql #datavault #dbt #freebsd #linux #python #emacs I'm here for the fun

Q: How to sort arrays in PostgreSQL?

A: `select array(select unnest(x) order by 1)`

where `x` is a column of array type.

That's the neatest implementation that I was able to find.

I was hoping for optimized `array_sort()` but it doesn't seem to exist.

Interestingly, I couldn't find any mention of `array()` in Postgres docs.

#postgres #sql

There might be a right way, but it's still unclear which one would that be.

I love how diverse the landscape is ATM.

In #postgres, BRIN index does not support min()/max().

A little unexpected... :(

That would be useful for dbt incremental models pulling data from large naturally ordered tables.

Have you considered a more generic approach for time series in general?

This could be used not only for financial data but other things, e.g., sensors, etc

A small glider in TikZ...

```

\documentclass{standalone}

\usepackage{tikz}

\usetikzlibrary{backgrounds}

\begin{document}

\begin{tikzpicture}[background rectangle/.style={fill=white}, inner frame sep=0, show background rectangle]

\foreach \pos in {(1,1), (2,1), (2,2), (3,2), (1,3)} {

\fill \pos rectangle +(1,1);

}

\draw[color=white, ultra thick] (0.5, 0.5) grid (4.5, 4.5);

\end{tikzpicture}

\end{document}

```

#tikz #gameoflife

Replying to Avatar mrkrd

On 2024-01-12, I participated in a mini workshop about Data Vault by https://www.scalefree.com. It is called Data Vault Friday, and one question from participants is answered in detail. Last week, someone asked about modeling of dates in reference tables. It was relatively basic, but well structured, and most importantly true DV2.0 material -- I'll keep attending it.

#datavault #datawarehouse

On 2024-01-12, I participated in a mini workshop about Data Vault by https://www.scalefree.com. It is called Data Vault Friday, and one question from participants is answered in detail. Last week, someone asked about modeling of dates in reference tables. It was relatively basic, but well structured, and most importantly true DV2.0 material -- I'll keep attending it.

#datavault #datawarehouse

+-----------+

| ASCII box |

+-----------+

#ascii using Unicode Full-Width Characters: http://xahlee.info/comp/unicode_full-width_chars.html

I'm excited to read a draft for the new Data Architecture Specification in Data Vault 2.1 #datavault

https://datavaultalliance.com/news/dv/dv-standards/dv2-1-draftdataarchspec-v2-1-0/

TIL that adding a unique constraint to a table in #postgres will automatically create an index.

I've discovered after noticing duplicated indexes in one of our tables.