![]() | |
![]() |
| | Thread Tools | Display Modes |
#51
| |||
| |||
|
|
In article<iul48k$9v1$1 (AT) speranza (DOT) aioe.org>, Don Y<nowhere (AT) here (DOT) com> wrote: Are those parameters effectively "hints of a different color"? I.e., hints regarding the makeup of the *data* themselves instead of a particular *query*? As Laurenz has explained, they're not. But as I understand it, the PostgreSQL developers who are opposed to adding 'traditional' hints think that the kind of hint you're describing here is worth considering. |
#52
| |||||||
| |||||||
|
|
Ah! *But*, it can only "worsen (or improve) performance" -- not affect the "correctness" of the result? |
|
So, you stumble over them when a particular query (etc.) unexpectedly proves to be more expensive than you had "expected"? |
|
And, presumably, hints only benefit *specific* dataset-query combinations. I.e., change the query and the hint's value may change? |
|
The DBA (or more likely the programmer), who has knowledge about the data that is not evident from the database layout (like "no male can ever have an abortion") can sometimes know more than the planner. OK. That would be very application-specific (and dataset-specific) knowledge, though. (?) |
|
Not quite, because routine vacuuming is not done by the end user who executes statements, but by an administrator. The end user will not have the necessary permissions to vacuum all tables in the database. Yes, understood. I'm thinking about *my* applications where there is an agent interposed between the end user and the DBMS acting as if the administrator. So, it can run some commands on behalf of the user and *then* decide to VACUUM (having inherent knowledge of the consequences of those commands). |
|
With non-automatic vacuum, the DBA can for example schedule a daily VACUUM of all tables at 11 p.m. because he or she knows that nothing much is going on at that time. That assumes you have sufficient free store to let a day's worth of "garbage" accumulate. |
|
WAL is unimportant for you only then if data loss is not a problem for you, and yesterday's backup is good enough. In my case, the opposite is true -- the application needs to avoid "stumbling", if at all possible. Going back to yesterday's dataset would be very painful. |
#53
| ||||
| ||||
|
|
And, presumably, hints only benefit *specific* dataset-query combinations. I.e., change the query and the hint's value may change? Yes. A query hint is part of the query and refers to certain parts of it. |
|
Not quite, because routine vacuuming is not done by the end user who executes statements, but by an administrator. The end user will not have the necessary permissions to vacuum all tables in the database. Yes, understood. I'm thinking about *my* applications where there is an agent interposed between the end user and the DBMS acting as if the administrator. So, it can run some commands on behalf of the user and *then* decide to VACUUM (having inherent knowledge of the consequences of those commands). That sounds like a really bad idea. If the database user that performs SQL on behalf of the end user has superuser privileges, that constitutes an unnecessary risk. Security holes or bugs in your software can cause much more damage that way. |
|
With non-automatic vacuum, the DBA can for example schedule a daily VACUUM of all tables at 11 p.m. because he or she knows that nothing much is going on at that time. That assumes you have sufficient free store to let a day's worth of "garbage" accumulate. Of course. |
|
WAL is unimportant for you only then if data loss is not a problem for you, and yesterday's backup is good enough. In my case, the opposite is true -- the application needs to avoid "stumbling", if at all possible. Going back to yesterday's dataset would be very painful. Then you need to learn about WAL and point-in-time recovery. |
#54
| |||
| |||
|
|
Yes, understood. I'm thinking about *my* applications where there is an agent interposed between the end user and the DBMS acting as if the administrator. So, it can run some commands on behalf of the user and *then* decide to VACUUM (having inherent knowledge of the consequences of those commands). That sounds like a really bad idea. If the database user that performs SQL on behalf of the end user has superuser privileges, that constitutes an unnecessary risk. Security holes or bugs in your software can cause much more damage that way. No choice. There is no "organic" DBA involved. So, even if I let autovacuum handle that aspect, there will always be other aspects that have to be "coded" (and "Just Work") |
#55
| |||
| |||
|
|
Don Y wrote: Yes, understood. I'm thinking about *my* applications where there is an agent interposed between the end user and the DBMS acting as if the administrator. So, it can run some commands on behalf of the user and *then* decide to VACUUM (having inherent knowledge of the consequences of those commands). That sounds like a really bad idea. If the database user that performs SQL on behalf of the end user has superuser privileges, that constitutes an unnecessary risk. Security holes or bugs in your software can cause much more damage that way. No choice. There is no "organic" DBA involved. So, even if I let autovacuum handle that aspect, there will always be other aspects that have to be "coded" (and "Just Work") You can automatize administrative tasks, that's a good thing, but that does not necessitate that the end user gets served by a superuser account. Those things should be done separately. You won't get away without some sort of human DBA. You must at least ascertain that backups complete successfully and space doesn't run out. And you need somebody who is able to restore a backup. So at least when things go wrong, you need a DBA. |
#56
| ||||
| ||||
|
|
The sorts of relations are all predefined. A (cell phone) "user" could opt to add a name to his "contact list". Or, delete one. Or "edit" an existing contact. Or, purge the log of the least recent calls. etc. He might even want to add "another" contact list (named "business contacts"), etc. |
|
But, he's not creating any arbitrary relations. And, the queries he'll run are predefined -- with "fill in the blank" parameters, etc. |
|
I.e., if PostgreSQL can't keep the relations intact, then it has fundamental bugs (in which case, why would *anyone* be using it?). |
|
shrug> We'll see. AFAIK, it hasn't been tried on this large a scale previously (?) As I said, the things I'm expecting from the DBMS are probably different than what most users/DBA's would expect. |
#57
| |||||
| |||||
|
|
Don Y wrote: The sorts of relations are all predefined. A (cell phone) "user" could opt to add a name to his "contact list". Or, delete one. Or "edit" an existing contact. Or, purge the log of the least recent calls. etc. He might even want to add "another" contact list (named "business contacts"), etc. This is pretty vague, but it sounds like nothing you need a superuser account for. |
|
Keep administrative stuff (VACUUM, backups) separate from the rest. But, he's not creating any arbitrary relations. And, the queries he'll run are predefined -- with "fill in the blank" parameters, etc. Yup, that's exactly where the user can use SQL injection to break into your database. |
|
I.e., if PostgreSQL can't keep the relations intact, then it has fundamental bugs (in which case, why would *anyone* be using it?). You misunderstood me. PostgreSQL will keep its stuff consistent. |
|
If somebody breaks into your database with a superuser account, he or she can very consistently read and change everything in the database, access the file system, and theoretically do anything with your machine that the OS user has permissions to do. |
|
shrug> We'll see. AFAIK, it hasn't been tried on this large a scale previously (?) As I said, the things I'm expecting from the DBMS are probably different than what most users/DBA's would expect. I don't want to play Kassandra here, but most of the people who want to use a software for something else than the intended use become quite unhappy in the end. |
![]() |
| Thread Tools | |
| Display Modes | |
| |