Detoasting optionally to make Explain-Analyze less misleading
От | stepan rutz |
---|---|
Тема | Detoasting optionally to make Explain-Analyze less misleading |
Дата | |
Msg-id | ca0adb0e-fa4e-c37e-1cd7-91170b18cae1@gmx.de обсуждение исходный текст |
Ответы |
Re: Detoasting optionally to make Explain-Analyze less misleading
|
Список | pgsql-hackers |
Hi, I have fallen into this trap and others have too. If you run EXPLAIN(ANALYZE) no de-toasting happens. This makes query-runtimes differ a lot. The bigger point is that the average user expects more from EXPLAIN(ANALYZE) than what it provides. This can be suprising. You can force detoasting during explain with explicit calls to length(), but that is tedious. Those of us who are forced to work using java stacks, orms and still store mostly documents fall into this trap sooner or later. I have already received some good feedback on this one, so this is an issue that bother quite a few people out there. Attached is a patch for addressing the issue in form of adding another parameter to explain. I don't know if that is a good idea, but I got some feedback that a solution to this problem would be appreciated by some people out there. It would also be nice to reflect the detoasting in the "buffers" option of explain as well. The change for detoasting is only a few lines though. So the idea was to allow this EXPLAIN (ANALYZE, DETOAST) SELECT * FROM sometable; and perform the detoasting step additionally during the explain. This just gives a more realistic runtime and by playing around with the parameter and comparing the execution-times of the query one even gets an impression about the detoasting cost involved in a query. Since the parameter is purely optional, it would not affect any existing measures. It is not uncommon that the runtime of explain-analyze is way unrealistic in the real world, where people use PostgreSQL to store larger and larger documents inside tables and not using Large-Objects. Here is a video of the effect (in an exagerated form): https://www.stepanrutz.com/short_detoast_subtitles.mp4 It would be great to get some feedback on the subject and how to address this, maybe in totally different ways. Greetings from cologne, Stepan Stepan Rutz - IT Consultant, Cologne Germany, stepan.rutz AT gmx.de
Вложения
В списке pgsql-hackers по дате отправления: