Is there a tool which tells you (or gives you a hint) why a particular select statement dose not return any rows given the current data in your database.
eg if you had the following 4 table join
select *
from a, b, c, d
where a.b_id = b.id
and b.c_id = c.id
and c.d_id = d.id
If there were rows which satisfied the conditions a.b_id = b.id also rows which satisfied b.c_id = c.id but no rows which satisfied the condition c.d_id = d.id it would highlight c.d_id = d.id as the problem.
Ie it would brake up the where clause and find out which of the sub conditions returned true and highlight those which do not return true.
It would not work well for complex querys but many select statements are simple joins over lots of tables.
This would be useful when creating test data to exercise a peace of application code or debugging a problem with a live system.
Graphical explain tools (that show the plan of the actual exiection path) come close but they show too much info and do not highlight the missing link in the select stament.
I am using postgres, sqllight and mysql but would be interested in how tools for other databases/platforms work.
Im also interested in any manula techniques.
Does anybody else have this problem?
Would anybody be interested if I wrote such a tool?