Top new questions this week:
|
I have a table with a 4-part composite clustered primary key (A, B, C, D), ordered on A,B,C,D. I must walk this entire table in batches by taking N records, then taking the next N records starting at …
|
I am in the process of configuring an Availability Group in SQL Server 2019 on Windows Server 2019. We have two Windows Servers, UT01 and UT02, configured with a single network adapter, using static …
|
Fiddle: dbfiddle.uk/-JLFuIrN Table CREATE TABLE files ( id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text ); CREATE TABLE folders ( id bigint GENERATED ALWAYS AS IDENTITY …
|
I understand there are lots of similar problems and threads but non of those solution helped me. Please read through the thread I will try to give as much information as possible: I have setup a …
|
I need to write a shell/bash script that automatically changes some PostgreSQL configurations. Here’s the command that I wrote: sudo -u postgres psql -U postgres -d postgres -c ” ALTER SYSTEM SET …
|
Changing only limit from 40 to 50 in following query triggers different execution plans. And unfortunatly one I needed is much slower. So the question is: why this happening and how can I force …
|
I am investigating how I might structure a PostgreSQL table to store a large amount of time stamped data that also needs to be portioned by another field. My expected data structure will be something …
|
Greatest hits from previous weeks:
|
I have a user defined function: create function ut_FooFunc(@fooID bigint, @anotherParam tinyint) returns @tbl Table (Field1 int, Field2 varchar(100)) as begin — blah blah end Now I want to join …
|
The case is simple: You have a MySQL database where you have only an SQL query interface and you want to know the database structure with queries. You can list tables with show tables; command, but …
|
Is there a best practice between using a LEFT JOIN or a NOT EXISTS format? What is benefit to using one over the other? If none, which should be preferred? SELECT * FROM tableA A LEFT JOIN tableB B …
|
For our application we have a configuration file for connecting to the Oracle database (URL, username, password). The application takes 2-5 minutes to start. If there is something wrong with …
|
I have made a draft remote application on top of libpq for PostrgreSQL. It behaves well, but I have profiled the general functioning of the application. For each final business result that I produce, …
|
I forgot how I started PostgreSQL the last time (it was months ago) and I don’t remember where the data directory is located. The postgres command seems to require the location of the data directory. …
|
When I try to drop a database I get the error “Cannot drop database “dbname” because it is currently in use”. However, when I run sp_who2, there are definitely no sessions connected to this database. …
|
Can you answer these questions?
|
I have an AWS RDS Mysql master with 1 AWS RDS slave and 1 ec2 mysql slave replicating this master instance. I already set the binlog retention hours to 7 days with the command: CALL mysql….
|
I need to write a PostgreSQL script that can be executed repeatedly. I want to add a column for my table, and check if the table and column exist, and add comment. So I write this: ALTER TABLE IF …
|
Good morning team, I’m really struggling to improve the performance of this function: sys.fn_cdc_map_time_to_lsn. It is a system function which is used by CDC, you can read a full description of what …
|