Skip to content

Tag: sqlperformance

Optimizing MySQL-Query for removing duplicates and adjusting foreign key references

i have following tables:address_table and customer_address_table The address table stores addresses and the customer_address table stores the relation between customer and address. A customer can have multiple addresses, therefore the second table. In the address table there are duplicate rows (different id but same location) and there is an address_id reference for each address in the customer_address table, so each

Why to use Correlated Subqueries?

As far as I’ve seen, correlated subqueries can be re-written using multiple-column subqueries or joins. And they usually perform better than correlated subqueries. So in which possible scenarios a correlated subquery can be a better option or the only option? (I use Oracle Database) Answer Oracle has a good optimizer, but correlated subqueries are sometimes the most efficient way to