SQL EXPLAIN badly needed (profiler or output) #1534

Open
iazi opened this Issue Jun 26, 2012 · 7 comments

7 participants

@iazi

There seems to be no option with codeigniter's active record to enable EXPLAIN before SQL statements. It would be nice having it in the profiler for example.
Joan

@Maaark

Yes indeed! I would love to see this in the profiler.

@rebizu

yes that would be a great feature. the only thing i can see as a problem is that the different databases handles it very different.

see here for examples http://stackoverflow.com/questions/1357975/explain-select-in-other-databases

@DavidOtis

It seems to me that this should be handled in the individual db drivers because each different database has different explain syntax. Instead of printing them in the in the profiler, I think an explain function should just return the results which would allow users to print/log/email or do whatever else they want to with them. Thoughts?

@jim-parry

Should there be an explain() method in the DB_Driver, with optional parameters?
No expectation about what it returns, nor about the parameter interpretation ... just an expectation that each database driver will implement it in an appropriate fashion.

@DavidOtis

Yes, I think there should be an explain() method in the DB_Driver, but I'm not sure what optional parameters it would need. Shouldn't it just take in the query to be explained?

@narfbg

"No, I don't think we should have [put functionality name here]" - said no user ever. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment