2634
English speaking PostgreSQL public chat. This group is for discussions on PostgreSQL-related topics and strives to provide best-effort support as well.
Hello and welcome to this chat. Here we discuss PostgreSQL and provide best-effort voluntary support on Postgresql issues.
If you have any question, try asking kindly, including log files, error descriptions and perhaps what you're trying to do.
- 🚫 photos and screenshots
- 🚫 spam and offtopic
- ✅ questions with log files and clear explanation of what's gone wrong
⬇️ Press the button down here ⬇️
No it will not create any issue, but best practice is to install etcd on separate vm
Читать полностью…
I have a question, if I have set a replication, and the secondary server fails for a reason. How postgreSQL is handling this situation even though if I have disabled wal keep segment parameter?
so how when the secondary server is up, it makes sure it has all the older wals to keep align with the primary? Do I have to enable wal keep segment? and what will happen if I disabled it, I won't be able to recover to a point where I don't have some wals sent?
Hello and welcome to this chat. Here we discuss PostgreSQL and provide best-effort voluntary support on Postgresql issues.
If you have any question, try asking kindly, including log files, error descriptions and perhaps what you're trying to do.
- 🚫 photos and screenshots
- 🚫 spam and offtopic
- ✅ questions with log files and clear explanation of what's gone wrong
⬇️ Press the button down here ⬇️
Also, GLEB I do this process for many things. So, you will see a HUGE performance benefit if you DROP (before loading data) and RECREATE The indexes AFTER loading the data.
TRUNCATE table1; DROP index ... on table1;
LOAD DATA (Copy format is fast, and select from table is fast).
CREATE index ...;
You need to play with it to prove it is true for you. IF the ONLY index you have is an ID (Sequence). Then it is probably fine to leave it alone. But if you have many indexes. These will consume a huge amount of time, versus loading data.
FINALLY, I *MIGHT* not do "DROP ON COMMIT" if I intended to use do this operation in a script.
I would want to commit my truncate. commit my index dropping.
Double Finally, if you are only loading the 5% of the data back in. The indexes are probably not a big deal.
If 5% is a TON of records. It could be.
And I would VACUUM ANALYZE that table when done to make sure statistics are 100% up to date.
But that's just me... I careful like that... LOL
but remember ON COMMIT DROP else they'll stay there until you close the session (might or might not be an issue in your case)
(this will also have the side effect of VACUUMing the table for free)
Читать полностью…
If your requirement is to oversize this configuration up to multiple millions, considering using partitioned tables and dropping partitions
Читать полностью…
Hi! I have a table with ~500k records. The average load is ~5 rps. The nature of working with the table is as follows: records are inserted and changed only once during the day. That is, if the record is in the table, it will be updated 1 time during the day and left just for statistics. I need to delete 95% of the entries first, without filters. Is it OK to delete with one query "DELETE", or should it be split into several small ones?
Читать полностью…
Excellent point. We actually set ours to 1.0 and don't see a any real impact (On Dev and Staging).
So we will be monitoring as we do deeper testing...
1.1 sometimes is even too high, had to reduce it to 1.05 on my db
Читать полностью…
That's useful if different tablespaces are on different kinds of underlying media. For example, sometimes the tables themselves are on spinning disks, and the indexes are on SSDs (this is less common than it used to be, but it still happens). Setting those parameters on a per-tablespace basis lets you adjust them to reflect the different performance of the two different kinds of media.
Читать полностью…
Any good documentation for creating a Master-Slave using Patroni?
Читать полностью…
Hi team
How to avoid serilization error in pg_repack
time pg_repack -h hostname -U user -t table -d db -k -- no-kill-backend
Getting error -set transaction level must be called before any query
Detail-Begin isolation level serailizable
Please let me know how to avoid this errror
Which one of Patroni and repmgr is best recommend to use for HA and easy to setup?
Читать полностью…
While setting up the HA using patroni installing etcd and postgresql in the same vm will make any issue??? Or I should use dedicated vm for etcd??
Читать полностью…
* It doesn't. Once the stream of WAL segments is cut off, the replica fails to follow its primary
* If you can't set up a WAL archive, use a replication slot. That ensures the primary doesn't recycle WAL segments the secondary didn't receive yet
Hello and welcome to this chat. Here we discuss PostgreSQL and provide best-effort voluntary support on Postgresql issues.
If you have any question, try asking kindly, including log files, error descriptions and perhaps what you're trying to do.
- 🚫 photos and screenshots
- 🚫 spam and offtopic
- ✅ questions with log files and clear explanation of what's gone wrong
⬇️ Press the button down here ⬇️
Hi all
Anybody wants to connect for mongo db training
Please let me know
Regards
Sri
Hello and welcome to this chat. Here we discuss PostgreSQL and provide best-effort voluntary support on Postgresql issues.
If you have any question, try asking kindly, including log files, error descriptions and perhaps what you're trying to do.
- 🚫 photos and screenshots
- 🚫 spam and offtopic
- ✅ questions with log files and clear explanation of what's gone wrong
⬇️ Press the button down here ⬇️
like this?
BEGIN;Читать полностью…
CREATE TEMPORARY TABLE tmp_t AS
SELECT * FROM my_table WHERE condition;
TRUNCATE TABLE my_table;
INSERT INTO my_table SELECT * FROM tmp_t;
COMMIT;
Or, if you keep 5% of the rows randomly you could also consider:
- open a transaction
- select 5% of the rows in a temporary table (using TABLESAMPLE ideally)
- TRUNCATE the table (instantly deletes all record)
- COPY records back to the table
- COMMIT
You can delete with just one query, but keep in mind it'll lock other queries for a little bit more time
Читать полностью…
Keep in mind this was only after very complex queries with 6-7 sub queries
Читать полностью…
More directly, Disks Vs. SSDs. Random Reads on SSD are only a touch slower than sequential reads (due to cache optimization on reading sequentially).
But on a hard disk. The cost of reading a page from ANYWHERE on the disk. Versus reading the sequentially NEXT page is WILDLY different. Hence the default values. They assume spinning RUST is being used. NOT SSDs.
In SSDs the settings of 1.0 and 1.1 are very common for PG databases.
Ultimately, the purpose has to do with the optimizer choosing the best approach to fetch your data. For tiny tables, it doesn't really matter. But if you have 20 Billion rows... Do you want the optimizer thinking the sequential scan will be MUCH faster (full table scan) than reading the index first?
Finally, you can experiment with this by using EXPLAIN on a select. And changing the settings on that table or IN your session, and seeing the resulting changes (But mostly it probably wont matter on some random table as much as some critical table).
Oh, and always keep track of your changes... WHEN you changed them, and WHY you changed them in the config file (Cybertec Lorenz advice), I used this and was able to UNDO some changes I had forgotten I was testing (2yrs after I finished testing and forgot about them). 10yrs will go by... And you (and your predecessors) will be scratching their heads why the default isn't used.
HTH
Someone can explain about this parameters ?? Allows for setting seq_page_cost and random_page_cost on a per tablespace level
Читать полностью…
Experience is a crazy thing. Because you can build it yourself.
When I was in high school, I learned how to "Build" the operating system.
And on that disk were a few pieces of the code. I spent a full-time job's worth of time on that.
I learned a ton.
When I left. I did NOT have "Paid" experience. But I had "experience".
And I could bring the source code listings of code I had written, things I had done.
To the interview. (I was probably overly confident, LOL).
But I landed a solid job with "weak working experience", but TONS of technical experience.
Can you BUILD the database? Test/Validate bug patches? (Contribute to the community, and
show you are serious?). That could get you a Junior position with a company.l
How important is a certification in seeking jobs as a DBA? What is the main source of "yes, i do know postgresql" except experience?
Читать полностью…