Re: Behavior of the "Explain query" button with multiple queries in the window - Mailing list pgadmin-support

From Cecil Eduardo Campos Costa
Subject Re: Behavior of the "Explain query" button with multiple queries in the window
Date
Msg-id 1406054376.53388.YahooMailNeo@web160606.mail.bf1.yahoo.com
Whole thread Raw
In response to Behavior of the "Explain query" button with multiple queries in the window  (Nicolas Anonyme <pathogenyx@gmail.com>)
Responses Re: Behavior of the "Explain query" button with multiple queries in the window
List pgadmin-support

How could I unsubscribe from this group?


On Tuesday, July 22, 2014 7:34 PM, Nicolas Anonyme <pathogenyx@gmail.com> wrote:


Hello,

Today, one of my coworker was preparing several "update" and "insert"
queries, in a query window, and he pressed the "Explain query" button
to check the query plan, expecting it to be inoffensive.
He then sent me the requests to play them, but I immediately got some
errors about duplicate primary keys. After checking the related data,
all but one had been changed.
« - Hey, are you sure you did not already played the queries by error ?
- Yes, I only did an "explain" ... what the heck?... »
Hilarity ensues (I had luckily made a backup of the data just before).

The "Explain query" button seems to add an "EXPLAIN" keyword at the
start of the text so it only explains the first query, but other
queries will be simply played on the database.

So ok it was a bad idea, but we were wondering if it was the wisest
behavior or if maybe some countermeasures could be added in order to
enforce principle of least astonishment for layman users, like us.

Maybe like, :
* when pressing that button, only "explain" the first query of the
text field, and ignore the following queries + display a warning in
the message panel (I think it would be the best solution, imho, but I
guess it would need a basic syntactical parser to find the end of the
first query),
* change the tooltip of the button ("explain the first query, play
the next ones")
* add a pop-up warning if it seems to have several queries (« We said
"explain query" not "explain queries", do you still want to continue
?»)
* explain all the queries! (but I guess it would be a bit difficult
to implement without major UI and logic refactoring)
* a better solution that I did not think of :)
* no solution, because "it works like intended" (but I'd then
respectfully disagree on the intuitiveness of the feature)

(pgAdmin version : 1.18.1, linux and windows)

Thanks in advance for any feedback on this topic.

Best regards,
--
Nicolas


--
Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support

pgadmin-support by date:

Previous
From: Nicolas Anonyme
Date:
Subject: Behavior of the "Explain query" button with multiple queries in the window
Next
From: Raymond O'Donnell
Date:
Subject: Re: Behavior of the "Explain query" button with multiple queries in the window