FAQ Database Discussion Community


Reduce row scan of update query without using index

mysql,sql-update,innodb,explain
I am using MySQL InnoDB engine. The result of below explain update query is EXPLAIN UPDATE H_M_SAMP SET NEW_M_ID=17 WHERE M_ID IN(363) Primary key of H_M_SAMP table is H_M_ID. And there is no foreign key relation. Is it possible to reduce number of rows scan by the update query without...

EXPLAIN in postgresql not working

sql,postgresql,syntax,syntax-error,explain
I have the following SQL code but it's not working, it says syntax error: EXPLAIN DROP TABLE cool_table Does anyone know why? Edit: I wrote this because I was taught to always use EXPLAIN before running a query on the database to avoid running a task that's too much for...

MySQL - How can I know my query is tuned?

mysql,performance,explain
I'm creating a DB from scratch and I'm trying to create queries with performance in mind. For test purpose I filled my tables with test data. My query needs to join 3 tables: 2 with millions of rows and the third with hundred thousands rows. How can I know my...