Readit News logoReadit News
zapov commented on I don't need your query language   antonz.org/fancy-ql/... · Posted by u/polyrand
DaiPlusPlus · 3 years ago
SQL does have a significant drawback w.r.t. how databases are used today (imo): a SELECT query can only return a single resultset of uniform tuples: if you want to query a database for hetereogenous types with differing multiplicity (i.e. an object-graph) then you either have to use multiple SELECT queries for each object-class - or use JOINs which will result in the Cartesian Explosion problem[1] which also results in redundant output data due to the multiplicity mismatch - SQL JOINs also lack the ability to error-out early if the JOIN matches an unexpected number of rows.

And there are often problems when using multiple SELECT queries in a batched statement: you can't re-use existing CTE queries. Not all client libraries support multiple result-sets. It's essentially impossible to return metadata associated with a resultset (T-SQL and TDS doesn't even support named result sets...), which means you can't opportunistically skip or omit a SELECT query in a batch because your client reader won't know how to parse/interpret an out-of-order resultset, and most importantly: you need to be careful w.r.t. transactions otherwise you'll run into concurrency issues if data changes between SELECT queries in the same batch ()

[1] https://learn.microsoft.com/en-us/ef/core/performance/effici... and https://learn.microsoft.com/en-us/ef/core/querying/single-sp...

zapov · 3 years ago
Those are problems in MS Sql, certainly not in object relational DBs such as Postgres or Oracle. And its rather sad that instead of embracing that we ended up with Json as poor man replacement for such advanced usages. I guess non portability across DBs certainly doesnt help. I tried showing that 10 years ago: https://github.com/ngs-doo/revenj/ but it just resulted in confusion.
zapov commented on Heavy particles don’t explain gravitational lensing oddities   arstechnica.com/science/2... · Posted by u/isaacfrond
jvanderbot · 3 years ago
Sticking to TFA, and not ancillary information, I found this frustrating:

> Instead, the research team ran 75 different models with the initial conditions chosen at random. By chance, some of these created distortions similar to the ones seen in the real-world data, typically affecting only one of the four lensed images. So, the researchers conclude that the distortions in the lensed images are consistent with a dark matter halo structured by the quantum interference of axions.

Essentially the best contender aside from WIMPs is, as subject of TFA, axions. And axions have near-random interference and standing waves, which essentially scatters about light bent by gravitational lensing due to uneven gravity in the lensing object.

Essentially, if you randomize the field enough, you can eventually find, after enough trials, something that seems to match reality. And it just so happens axions are the nice random variables we needed to inject.

That's where we're at: Just randomly select some parameters until the data fits, and lo and behold, it fits.

zapov · 3 years ago
zapov commented on AWS announces forks of Elasticsearch and Kibana   aws.amazon.com/blogs/open... · Posted by u/ke4qqq
__blockcipher__ · 5 years ago
> And that "free software" licences especially the viral ones exemplified by GPL/AGPL are also still relevant in 2021, and having chosen one of those would have given Elastic.co what they claim to be demanding... (I think I agree there too.)

I think we agree up until this point, at which you fall into a trap. This is the same trap I was trying to avoid by giving my SSPL scenario above.

A copyleft license like GPLv3 does not prevent a business from operating a SAAS business.

AGPL would apply, but it only triggers upon modification. So as long as Amazon doesn't modify Elasticsearch itself, they don't have to publish anything (because there's nothing to publish), and if they do modify, they have to share just those changes. Which is very fair to me from a copyleft perspective.

Now SSPL tries to go further and say for merely using the software in a certain way, you must release not just any changes to the software itself but also everything around the software. That is what makes the SSPL neither open source nor free. (I guess I don't actually know how "free" is defined, so I can only say for certain that it's not open source, but I don't think SSPL even counts as copyleft)

zapov · 5 years ago
A much better description would be "distributing usage to others" instead of just "using". Which is much better analogy for what is going on here.
zapov commented on New In Postgres 12: Generated Columns   pgdash.io/blog/postgres-1... · Posted by u/craigkerstiens
SigmundA · 6 years ago
Yeah but it doesn't support .Net types directly everything must be translated between the two type systems. Also doesn't support executing .Net code in the PG process. These are the main mismatches that ORM's try to hide with significant overhead.
zapov · 6 years ago
The impedance mismatch is not about having to translate, but being unable to translate. An yes, that problem exist with relational-only database, but not with PG where you can create composite types, can have arrays of composite types as a column and all other goodies which come with that.

I personally do not find useful to execute .NET code in PG, but technically you could do that.

As long as you can translate LINQ expressions to PG as you can most of them with Revenj you can avoid the pitfalls of mainstream ORMs.

zapov commented on New In Postgres 12: Generated Columns   pgdash.io/blog/postgres-1... · Posted by u/craigkerstiens
SigmundA · 6 years ago
Having done both SQL and C# for a very long time I prefer C# with Linq. Linq gives you nearly all the declarative power of SQL with all the procedural goodness of C# to get things done.

Whats needed is a really good object database for C# to eliminate the impedance mismatch.

Don't get me wrong SQL is great, but to be useful it needs to be mixed with a procedural language (pl/SQL, T-SQL, etc) I would just prefer using a more capable typed procedural language instead.

zapov · 6 years ago
Postgres is object-relational database, so it can certainly be used in such a way (and I use it like that most of the time).

But this is quite a niche usage of PG and there are little to zero tools supporting it.

zapov commented on Google Docs gets an API for task automation   techcrunch.com/2019/02/11... · Posted by u/Manu1987
zapov · 7 years ago
I’m glad to see that binding data with document templates is slowly becoming used more often. I always saw it as a killer feature, and actually built one of my products around that idea way in 2011 [1].

Once you leave the simple use cases of just replacing tags it gets quite complicated, but you can build really complex documents that way [2].

  [1] http://templater.info
  [2] https://github.com/ngs-doo/templaterexamples

zapov commented on Web Framework Benchmarks   techempower.com/benchmark... · Posted by u/ksec
hungerstrike · 8 years ago
Can you request multiple heterogeneous result-sets from PG now, with something that looks like a stored procedure?

I'd love to see what that looks like. In SQL Server it's as easy as putting 2 SELECT statements in the same procedure.

zapov · 8 years ago
zapov commented on Web Framework Benchmarks   techempower.com/benchmark... · Posted by u/ksec
hungerstrike · 8 years ago
I think it would have been even faster if they'd test with SQL Server because you can do things with SQL Server that you simply cannot do in PG such as stored procedures that return multiple resultsets, which saves a ton of round-trips.
zapov · 8 years ago
You can do even more advanced stuff in Postgres, but they've changed the rules to dissalow it since it much more faster than the the current best ones. Something about being fair to other frameworks...
zapov commented on Mison: A Fast JSON Parser for Data Analytics [pdf]   vldb.org/pvldb/vol10/p111... · Posted by u/fanf2
javajosh · 8 years ago
They quite clearly state that Jackson is the fastest, later in the paper.
zapov · 8 years ago
But it's not. It's just the default/most popular one.

It's up from 2x slower than fastest Java one, as clearly shown in the links.

u/zapov

KarmaCake day83September 14, 2011
About
Invasive software composition platform based on DDD https://dsl-platform.com/

Minimal reporting library for .NET and Java https://templater.info/

.NET/Java framework https://github.com/ngs-doo/revenj

Java JSON library https://github.com/ngs-doo/dsl-json

View Original