dimanche 1 février 2015

How to make architecture for calculating database user's skill using query optimization rules?


I want to make architecture to calculate skill of database user. The idea behind this is that I made some set of questions(first which include reading data with some conditions and some questions includes indexing usage).


After submission of the answers I will check those rules on the queries which is submitted by user( examples:


how user is joining multiple tables using Exists or Join


how user is applying conditions using having or where


while joining, user is using table alias or not


whether user is Avoiding * in SELECT Clause or not :


because it is a very inefficient one as the * has to be converted to each column in turn. etc)


For Example:


Least Efficient :


SELECT *

FROM EMP (Base Table) WHERE EMPNO > 0 AND DEPTNO IN (SELECT DEPTNO FROM DEPT WHERE LOC = ‘MELB’) Most Efficient :


SELECT *

FROM EMP

WHERE EMPNO > 0

AND EXISTS (SELECT ‘X’ FROM DEPT WHERE DEPTNO = EMP.DEPTNO AND LOC = ‘MELB’) So we need to design architecture and rule engine for this(In which we can test proper rule based on query requirement).If you have any idea, could you please tell how can I match those rules with queries provided by user except pattern matching and explain plan. It would be grateful if you could provide some help regarding same.





Aucun commentaire:

Enregistrer un commentaire