top of page
  • Writer's picturekyle Hailey

GraphGPT and Visual SQL Tuning




Get your OpenAI key at https://platform.openai.com/account/api-keys for use in GraphGPT



brew install node
git clone https://github.com/varunshenoy/GraphGPT 
cd GraphGPT
npm install
npm run start

this will/should popup a browser window for http://localhost:3000/



You can then drop in a SQL like


SELECT order_line_data
FROM
         customers cus
         INNER JOIN
         orders ord
         ON ord.id_customer = cus.id
         INNER JOIN
         order_lines orl
         ON orl.id_order = ord.id
         INNER JOIN
         products prd1
         ON prd1.id = orl.id_product
         INNER JOIN
         suppliers sup1
         ON sup1.id = prd1.id_supplier
   WHERE
         cus.location = 'LONDON' AND
         ord.date_placed BETWEEN '04-JUN-10' AND '11-JUN-10' AND
         sup1.location = 'LEEDS' AND
    EXISTS (SELECT NULL
            FROM
                 alternatives alt
                 INNER JOIN
                 products prd2
                 ON prd2.id = alt.id_product_sub
                 INNER JOIN
                 suppliers sup2
                 ON sup2.id = prd2.id_supplier
           WHERE
                  alt.id_product = prd1.id AND
                  sup2.location != 'LEEDS')

which get's diagramed like

which is pretty similar to Visual SQL tuning:



The above GraphGPT chart was from Feb 1. Now on April 27, 2023 it comes out incorrect :(








Of potential interest












114 views0 comments

Recent Posts

See All

Comments


bottom of page