You should take care about statistics!

Ever since Oracle introduced the CBO (Cost Based Optimizer) there were some performance issues, mostly because of missing or staled statistics in the database. I stopped to count the cases, when I just gathered fresh statistics for some table(s) and voilĂ  – the query runs 100x faster! I will mention just one of the latest ...

Wrong result returns when Subquery is unnested

A couple of days ago I got a request to take a look at one SQL query, which obviously returns the wrong result. The database version is 12.2 running on Windows on Azure Cloud. Simplified for the demo purpose it looks like this – the query returns 1 and 2, but it should return 1, ...