pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Brent Wood <Brent.Wood@niwa.co.nz>
To: Steve Litt <slitt@troubleshooters.com>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: SQL queries as sets: was The tragedy of SQL
Date: Wed, 15 Sep 2021 06:04:18 +0000
Message-ID: <SY4PR01MB7076F6AD34B49FF6980EBA5BA1DB9@SY4PR01MB7076.ausprd01.prod.outlook.com> (raw)
In-Reply-To: <20210915005449.150f2e45@mydesk.domain.cxm>
References: <4dc338ad-b0aa-4f4c-bd9c-4dc76dda9e8b@Spark>
	<d61c6062-32ae-4892-8993-9ad932e10b91@Spark>
	<CANW1aT-Q4e7X9zbaxs+r4ccGtZh8W+CA5=ozX6hDhaCrAzbsTQ@mail.gmail.com>
	<a6a667c4-0b3c-4505-9530-1c5e54d6e7b0@Spark>
	<alpine.LNX.2.20.2109140545490.306@salmo.appl-ecosys.com>
	<20210915005449.150f2e45@mydesk.domain.cxm>

I agree.

I've always thought SQL was a great example of set theory put into practice. You specify the elements (select items) and conditions (where clause) to return the (sub)sets you want.

Spatial data is also about sets - a polygon is theoretically defined as the set of points contained by a perimeter. A line is the set of points between specified points (complicated somewhat by coordinate systems). I have found the set based approach of SQL & relational databases is a very comfortable fit with spatial data queries - Postgres + Postgis is an awesome combination, then add hstore, jsonb & timescale to the mix and I have no need for a NoSQL db for key/value rather than normalised data.

I also suggest that as a simple language to retrieve stored data, SQL works well. But as we try to do more complex retrievals, the difference between a query to ask for data and a query to ask for a somewhat complex analysis of the data becomes very apparent. Yet these extensions, as is so often the case, are where the true power and the limitations of SQL can be found.

view thread (6+ messages)  latest in thread

Message-ID: <SY4PR01MB7076F6AD34B49FF6980EBA5BA1DB9@SY4PR01MB7076.ausprd01.prod.outlook.com>
Permalink:  ../SY4PR01MB7076F6AD34B49FF6980EBA5BA1DB9@SY4PR01MB7076.ausprd01.prod.outlook.com/
Also on:    postgresql.org/message-id/SY4PR01MB7076F6AD34B49FF6980EBA5BA1DB9@SY4PR01MB7076.ausprd01.prod.outlook.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: Brent.Wood@niwa.co.nz, slitt@troubleshooters.com
  Subject: Re: SQL queries as sets: was The tragedy of SQL
  In-Reply-To: <SY4PR01MB7076F6AD34B49FF6980EBA5BA1DB9@SY4PR01MB7076.ausprd01.prod.outlook.com>
  References: <4dc338ad-b0aa-4f4c-bd9c-4dc76dda9e8b@Spark> <d61c6062-32ae-4892-8993-9ad932e10b91@Spark> <CANW1aT-Q4e7X9zbaxs+r4ccGtZh8W+CA5=ozX6hDhaCrAzbsTQ@mail.gmail.com> <a6a667c4-0b3c-4505-9530-1c5e54d6e7b0@Spark> <alpine.LNX.2.20.2109140545490.306@salmo.appl-ecosys.com> <20210915005449.150f2e45@mydesk.domain.cxm> <SY4PR01MB7076F6AD34B49FF6980EBA5BA1DB9@SY4PR01MB7076.ausprd01.prod.outlook.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox