views:

25

answers:

2

I wonder if some open-source SQL database servers have a possibility, how to find out (maybe even in graphical representation), what actually happened inside during the query (e.g. whether table scan was used, or if and which index(es) were used..) step-by-step. It would be useful for database optimization.

+1  A: 

Most servers have some sort of way to display a query execution plan. Explain query in mysql, for instance. Which server are you using?

zevra0
i'm not sure that execution plan is exactly what i want.. is possible to do something like [this](http://www.dba-oracle.com/t_sql_rewrite_complex_queries_with_clause_temporary_tables.htm) in sqlite or mysql? anyway, thanks for the *execution plan* keyword, i was not aware of this feature
mykhal
.. well, first i tried `EXPLAIN QUERY PLAN query` which did not tell me anything, but now i see that `EXPLAIN query` might more that i want (sqlite)
mykhal
Right, EXPLAIN query should be what you are looking for in sqlite.
zevra0
@zevra0 what about mysql and postgres? why don't you post ann answer? ;)
mykhal
The plans are text-based, usually displayed in a table. As Rawheiser said, I'm sure that graphics GUI are available, but not as part of mysql. In mysql, EXPLAIN %query% would display the steps and choices that are made when processing a query on the server. What, exactly, are you looking for an answer?
zevra0
A: 

Most all will have tools/commands to describe query plans, the graphical part you may have to pay for.

Rawheiser