Tag : mysql

select productline, customerName, totale from
(SELECT productLines.productline, customers.customerName, sum(quantityOrdered) as totale
from customers, orders, productlines, products, orderdetails
WHERE customers.customerNumber = orders.customerNumber
and orderdetails.orderNumber= orders.orderNumber
and orderdetails.productCode = products.productCode
and productlines.productLine= products.productLine
GROUP by productlines.productline, customers.customerName
order by sum(quantityOrdered) desc )
as lista
group by produc..

Read more

I have a Percona 8 MySQL Server, running via Docker, acting as the backing data store for a heavily used service.
On the hour, a script will run that reads a value from a virtual column of approximately 1.7 million rows (Table size estimate of 2.3 GiB) and inserts this particular value and the associated key data into another table that the system otherwise only reads from. The virtual column is a JSON lookup json_extract(jsonData, '$.root.interestingValue') and has the GENERATED flag.
The idea behind this is to put less pressure on the table that is considered live and updated regularly, when users are only interested in a few specific values and retrieving the absolute latest value is not req..

Read more