> OpenAI helper: If you have an OpenAI account, the interface can query OpenAI to help you understand your query plan and optimize your SQL queries<p>How good are LLMs at optimizing queries? Do they just give basic advices like "try adding an index there" or can they do more?<p>I guess it would need to cross the results of the explain analyze with at least the DDLs of the table (including partitions, indexes, triggers, etc), and like the sizes of the tables and the rate of reads/writes of the tables in some cases, to be able to "understand" and "reason" about what's going on and offer meaningful advices (e.g. proposing design changes for the tables).<p>I don't see how a generic LLM would be able to do that, but maybe another type of model trained for this task and with access to all the information it needs?