Re: AI for query-planning?

From: Pyrote <pyromania(at)guungle(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: AI for query-planning?
Date: 2024-06-22 15:23:36
Message-ID: Mime4j.0.119d5663639953cb.190408bb51e@imap.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

<div dir="auto">The current forms of “AI” have no concept of state or long term memory. On each invocation of the AI you have to tell it,</div><div dir="auto"><br></div><div dir="auto">This is a Postgres database.</div><div dir="auto"><br></div><div dir="auto">This is my database schema.</div><div dir="auto"><br></div><div dir="auto">These are the indexes I have.</div><div dir="auto"><br></div><div dir="auto">After providing that information the “AI” “might” generate a valid query for your particular database but it won’t be optimum. The AI doesn’t know how many rows are in each table, the physical media each table is on, or any other attributes about your database that would be used to calculate the cost of using an index or a table scan.</div><div dir="auto"><br></div><div dir="auto">So then you could make the jump that an “AI” should be ran locally and trained exclusively on your database. Now you are using a general purpose “AI” algorithm for a very specific task which would not be optimum. It would require constant retraining which would be computationally expensive.&nbsp;</div><div dir="auto"><br></div><div dir="auto">Then let’s say you want to write an “AI” algorithm just for Postgres. Now you have basically rewritten the current Postgres Optimizer in a round about way.&nbsp;</div><div dir="auto"><br></div><div dir="auto"><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jun 22, 2024 at 09:40 Adrian Klaver &lt;adrian(dot)klaver(at)aklaver(dot)com&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">On 6/22/24 04:50, Andreas Joseph Krogh wrote:
<br>&gt; Hi, are there any plans for using some kind of AI for query-planning?
<br>&gt;
<br>&gt; Can someone with more knowledge about this than I have please explain
<br>&gt; why it might, or not, be a good idea, and what the challenges are?
<br>
<br>1) Require large amount of resources.
<br>
<br>2) Produce high rate of incorrect answers.
<br>
<br>
<br>&gt;
<br>&gt; Thanks.
<br>&gt;
<br>&gt; --
<br>&gt; *Andreas Joseph Krogh*
<br>&gt; CTO / Partner - Visena AS
<br>&gt; Mobile: +47 909 56 963
<br>&gt; andreas(at)visena(dot)com &lt;mailto:andreas(at)visena(dot)com&gt;
<br>&gt; www.visena.com &lt;https://www.visena.com&gt;
<br>&gt; &lt;https://www.visena.com&gt;
<br>
<br>--
<br>Adrian Klaver
<br>adrian(dot)klaver(at)aklaver(dot)com
<br>
<br>
<br>
<br></blockquote></div></div>

Attachment Content-Type Size
unknown_filename text/html 2.4 KB

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Shaheed Haque 2024-06-22 17:01:44 pg_dump restores as expected on some machines and reports duplicate keys on others
Previous Message Christoph Moench-Tegeder 2024-06-22 15:21:07 Re: AI for query-planning?