Whaty could be the cause of postgres functions losing or swapping values from a CTE?

I have a number of functions which are generally in this shape:

RETURN QUERY with cte1 as (    select a, b, c, d, e    from [some_table]    where [some_condition] ), cte2 as (     select x, y, z     from [big_table]     where [bunch_of_conditions] ) select foo.x, foo.y, bar.a, bar.b, bar.c, bar.d from cte2 foo join cte1 bar on foo.z = bar.a 

I have seen occasions where the values of bar.b and bar.d are swapped, and on others no values are returned – upon investigation, because bar.a contains only nulls.

In all cases, when I take the code out of the functions, it always runs correctly. In each case where it goes wrong, there is nothing I can point to which causes the glitch, and usually it goes away for no obvious reason. This is all running in pgAdmin under Windows 10, and the behaviour persists through stopping pgAdmin, and/or rebooting the PC.

The db where this happens is running on AWS, and I don’t have access to stop/restart that server.

It suggests to me that the problem is happening at the AWS and/or postgres server end, but that may or may not be correct.

Possibly also relevant, we have also seen cases where queries run exceptionally slowly (45 minutes instead of less that one second, being one example today).

In each case of the swap or the slowdown, it eventually returns to normal behaviour without any obvious intervention from me. I’m still experiencing the null value which should be populated.

Has anyone seen behaviour like this? Any ideas what could be causing it, or how to remedy it?

Could a slow website cause visitors from a Facebook ads campaign to bounce?

I have a website with traffic problems. The web site sells a product in Spanish.

I recently created a Facebook ads campaign, and it got 96 visits. But Google Analytics only registered 9 visits. I think my website could be slow and people are bouncing. Could this be the case?

I am using WordPress and the Profitbuiler plugin to create the page.

What would cause cron jobs to fail? WordPress site unresponsive after migration

After a server migration, on a custom-configured server, a large WordPress site is becoming unresponsive once moderate traffic is pointed at it.

There seems to be no seemingly apparent reason for this, as server specs are very much sufficient. One clue is cron jobs are not running. Refreshing pages will not trigger them to run, and they report as "running now" or are scheduled for -40+ years ago (aka, to force them to run now)

However, this fixes it, in wp-config: define(‘ALTERNATE_WP_CRON’, true);

But, why? I feel like this is a symptom of what is wrong with the migrated website, as it does not function at all once it receives traffic (20+ second loading, and/or unresponsive). CPU load/etc, is withing "normal-high" range, aka normal. It just, seemingly dies. Disabling/enabling cache and cloudflare doesn’t change anyhting. The original site, same settings, functions great.

What would cause cron jobs to fail and a server to not handle traffic after a migration to a freshly configured server?

How are clockwork prosthetics and necrografts affected by effects that cause magic items to stop working?

Clockwork prosthetics and necrograft arms and legs are the rare examples of magic items to fully replace humanoid limbs, and unless they have a special ruleset on the matter they are as susceptible to antimagic fields or disjunction spells as any other magic item.

For any other magic item, it’s easy to predict what happens when they get affected by an effect that suppresses their magic : magic weapons revert to mundane masterwork weapons and other magic items stop having any effect and are totally useless. However, there are no rules about losing limbs except for some rules added by 3rd party publishers (that I tend to avoid except for a few rare exceptions) or I probably missed them, and the rules on prosthetics don’t explain what happens either.

If a magic prosthesis gets its magic suppressed does it :

  • totally stop working altogether and become inert (and apart from obvious penalties like not being able to wield weapons, how does it affect the wearer ?) ?

  • stop giving its specific benefit and still do its job as a limb replacement, imposing no additional penalty to the wearer ?

UDF in MS SQL Server returning a query starting with “with” cause

This is a perfectly valid SQL Query and works nicely (for e.g.) in Microsoft SQL Server 2014:

with t as (select 'a' as attr) select * from t 

it returns a, surely one can simplify it and drop the with part, but that’s not the point, the point is to find out a smallest example that illustrates the need/problem. I can pack part of it as a UDF:

CREATE PROCEDURE x(@__employee_id uniqueidentifier) AS RETURN (select 'a' as attr); 

How can I pack a query that has with block? My aim is to achieve something like:

CREATE PROCEDURE x (@__employee_id uniqueidentifier) AS RETURN (     with t as (select 'a' as attr) select * from t ); 

however sql server does not like it, firing an error:

Msg 156, Level 15, State 1, Procedure x, Line 4 [Batch Start Line 0] Incorrect syntax near the keyword 'with'. 

Is there a 5e magic/mechanic that could cause an item to disappear/teleport/planeshift on death?

I am running a 5e campaign where my players may encounter the Xanathar. Being the murdering hobos that they are, they may eventually successfully kill him since he is just a normal beholder stat block. He has a couple magic rings, including a Ring of Mind Shielding.

I was thinking of having his soul go into the Ring of Mind Shielding on death and then have the ring disappear to a place he can be true resurrected/wished to life later on.

Would there be a mechanic/spell that allows me to do such a thing? I try my best to make things within the rules instead of just DM ‘it happens because I say so’.

Thanks in advance! The loss of the Xanathar to the realm would be truly disappointing.

Do the different wordings of the Great Weapon Fighting style printed in the PHB cause them to function differently?

I had a question about ‘Great Weapon Fighting’ as it applied to Paladins, which lead me here: Does Great Weapon Fighting apply to Superiority Die rolls? During my research. While the answer cleared up my original question, I have a follow up question.

First, my question: When rolling for Great Weapon Fighting style as a Paladin, does the differentiation detailed below mean I can continue to re-roll all 1’s and 2’s until I get a 3 or higher?

Secondly, the differentiation: I noticed there is a variance between the Great Weapon Fighting entry in the Fighter listing on PHB pg 72 :

When you roll a 1 or 2 on a damage die for an attack you make with a melee weapon that you are wielding with two hands, you can re-roll the die and must use the new roll, even if the new roll is a 1 or a 2. The weapon must…

Emphasis on the differentiation from the entry, of the same Great Weapon Fighting style, found in the Paladin listing on PHB pg 84 :

When you roll a 1 or 2 on a damage die for an attack you make with a melee weapon that you are wielding with two hands, you can reroll the die and must use the new roll. [missing] The weapon must…

This particular entry is missing the crucial “even if the new roll is a 1 or a 2.” This particular entry says, you may reroll any 1’s or 2’s and must use the new roll period .

This is more than likely a typo, as some do exist in the version of the PHB I have when it first came out. If anyone has any errata/newer versions of the PHB and can see if the full entry exists under Paladin please let me know in comments or in your answer should you submit one.