Should I use a temp table or join

I am creating a stored procedure in sql server 2019 that needs to use multiple select statements to get a parent row and then its related data. I have the primary key clustered value for the parent so the first query will at most return 1 row.

Should I select everything into a temp table for the first query and then join my subsequent queries to the temp or should I just keep joining to the original table?

I am not sure if the overhead of creating the temp table will overshadow the overhead of joining to the actual table repeatedly.

I have looked at the performance plans and they come out to be the same and the statistics for reads/scans and time are about the same as well.

I think what I am trying to figure out is if I use the temp table, will it relieve pressure on the original table. The original table is heavily read and written to.

I should note that these statements will be inside of a Stored Procedure so I may potentially get a boost from Temporary Object Caching.

Assume table A has > 1 million rows and has 0-10 rows per entry in TableB and 0-10 per entry in TableC

Simplistic Table Diagram

Queries without temp table

declare @taID bigint=123  select     ta.* from     TableA ta where     ta.ID=@taID   select     tb.* from     TableA ta     inner join TableB tb on ta.ID=tb.TableAID where     ta.ID=@taID  select     tc.* from     TableA ta     inner join TableC tc on ta.ID=tc.TableAID where     ta.ID=@taID 

Queries with temp table

declare @taID bigint=123  select *  into #tmpA from     TableA ta where     ta.ID=@taID  select * from #tmpA  select     tb.* from     #tmpA ta     inner join TableB tb on ta.ID=tb.TableAID  select     tc.* from     #tmpA ta     inner join TableC tc on ta.ID=tc.TableAID 

What concerns should I have with allowing a character to hurl bombs with Telekinetic Projectile?

I have a wizard player who wants to use Telekinetic Projectile to hurl bombs. I think this is cool, and would like to allow it, but I’m not sure if it would be too powerful or cause other issues.

Preparing and throwing an alchemical bomb takes one action, uses a weapon attack, and has a range increment of 20′.

Telekinetic Projectile is a spell which hurls "a loose, unattended object" at a target, dealing physical damage. Additionally, the spell states:

No specific traits or magic properties of the hurled item affect the attack or the damage.

Depending on how you read that, RAW may dictate that the bomb’s effects wouldn’t trigger. But you could read it as "the bomb’s effects don’t affect the spell attack or spell damage," which doesn’t say anything about the bomb’s effects not working separately.

That being said, can think of two possibilities for how to allow it to work:

  1. 1 action must be spent preparing the bomb, and then the regular 2 actions spent casting the spell.
  2. More strictly (and less fun), 1 action must be spent preparing the bomb, 1 action must be spent putting the bomb down carefully so it becomes "a loose, unattended object", and then 2 actions must be spent casting the spell. This would obviously be a 2-turn maneuver, unquickened.

Potential concerns and balance issues:

  1. Using the spell to hurl the bomb allows casters to use their spell attack for the throw, instead of their (probably worse) weapon attack roll.
  2. You’d get the spell damage and bomb effect from one attack roll, rather than having to do one attack (spell or bomb), and then a second attack at -5 (spell or bomb).
  3. Using the spell to hurl the bomb eliminates the bomb’s 20′ range increment and gives it a flat range of 30′ (unless the spell is given reach). So better at short ranges, but impossible to use at ranges over 30′.
  4. Possible that the rules intend for this gameplay style to be restricted to the alchemist class? This isn’t really a balance thing but more a "spirit of the game" thing, which isn’t high on my list of concerns for allowing my player to have a bit of fun.

Honestly, I’m not convinced that spending an entire turn to deal bomb effect + 1d6 + ability mod is terribly unbalanced. Not to mention that the wizard is limited by the amount of bombs he has. What concerns should I have with allowing a character to spend 3 actions to hurl a bomb with Telekinetic Projectile?

What Should I Give Level 20 Players [closed]

I really like giving out loot and spells but what should I give to level 20 players. It would be also really nice if someone should tell me what to give to low level players as well. I do own a copy of the DM’s handbook (and it tells me what to give) but should I give the less, more or the right amount. I’m asking about 5 edition dungeons and dragons.

One of my players want to carry his familiar on his body and says it should not be targeted by enemies because it can hide on his body?

One of my players (of a rogue) said that he heard of DM’s allowing the familiar to be carried on the players body. He use his familiar to help him in combat and get advantage on the attack roll.

I said it’s okay for me and allowed it. But later in fight I played a goblin and obviously attacked his familiar in his pocket, to take his advantage away. He said that it shouldn’t be possibly because his familiar hides in a pocket and can’t be targeted. I didn’t allow that because it would obviously break the game. He said that many DM’s bend the rule like this and allow this.

I would like to hear whether anyone has ever allowed this change of the rules, and whether it did or will break the game.

Should abilities have their state and functionality separated?

I’m developing a top-down game using Javascript and Canvas in an ECS architecture.

I’m wondering, which of these is better from a design / elegance point of view?

Method 1: Combining the ability function and its metadata into one object:

// in ability factory createBlinkAbility() {   return {     cooldown: 5000,     castTime: 1000,     hotkey: "q",     execute(entity: Entity, scene: Scene) {       let position = entity.get(CT.Position);        let level = scene.queryComponent(CT.Level);        position.x = Helpers.randomInt(0, level.width);       position.y = Helpers.randomInt(0, level.height);     }   } }  function executeCurrentCast(entity: Entity, ability: Ability) {   ability.execute(entity); // all abilities have an execute function } 

Method 2: Separating ability metadata from its function:

// in ability factory createBlinkAbility() {   return {     type: "blink",     cooldown: 5000,     castTime: 1000,     hotkey: "q"   } }  // in ability factory castBlink = (entity: Entity, scene: Scene) => {   let position = entity.get(CT.Position);    let level = scene.queryComponent(CT.Level);    position.x = Helpers.randomInt(0, level.width);   position.y = Helpers.randomInt(0, level.height); }  function executeCurrentCast(entity: Entity, ability: Ability) {   switch (ability.type) {     case "bow": this.abilityFactory.castBow(entity); break;     case "blink": this.abilityFactory.castBlink(entity); break;     ...   } } 

I know in general in an ECS architecture it is wise to separate "state" from "actions", but I’m not sure if this would also apply to things like abilities. It seems like it might be wise to maintain that separation, but the code seems like it might be "cleaner", or shorter at least, in the former case.

Lastly, I’m not really concerned with the performance differences between these two approaches, but rather which is better from a design standpoint.

How much loot (in GP) Should I be giving my players?

I’m very new to DMing. So I wan’t to get to a good start with the loot I give my players. We usually play in 2 hour sessions at college. This usually ends up being 1 days worth of in-game time. In this time I usually try to drop 2 Minor loot rewards, 1 Greater loot reward, and 0.5 Major loot reward (as I spread that over two 2-hour sessions).

How much loot (in GP) should I be giving my players each session to give them enough to pay for food and living, as well as purchase the occasional weapon or service?

I don’t want to drown them in money, devaluing the feeling of opening a chest of wealth, but I also don’t want to disappoint them by giving so little. Rather, just enough to keep them alive and going as well as ambitious to continue exploring dungeons and searching camp-sites. As I usually give rewards that are more sentimental or functional at the ends of quests (like Magic Items, Medals, Faction Invitations, and Benefits in the locations of the benefactor).

Because my players are changing in level and if similar DMs with different players refer to this question, could I please have an answer formatted to fit each level?

Which class should an armored Wizard multi-class with, and in what order?

For a Wizard who plans to be in battle, what factors should be considered when deciding between taking a level or two of Fighter or of Cleric, and when?

Fighter 1 would give the heavy armor proficiency and the proficiency on CON saves, and seems like a good way to go.

Cleric 1 would also give heavy armor proficiency, proficiency on WIS saves, and progresses the spell slots. L1 Cleric healing (and other) spells could be cast from higher level slots making this a nice “bonus” set of spells to have available.

I realize there are trade-offs and it’s not a factual question to ask which is better, but are there factors I’m failing to take into consideration?

Is there an argument for taking the first level of Wizard first? It seems like you lose out on more than you gain that way.

(If it matters, we’ll start playing at Level 3)

Should unarmed melee weapons like fists and claws have the *finesse* and *light* traits? [closed]

In DnD 5e you find under Melee Attacks:

Instead of using a weapon to make a melee weapon attack, you can use an unarmed strike: a punch, kick, head-butt, or similar forceful blow (none of which count as weapons). On a hit, an unarmed strike deals bludgeoning damage equal to 1 + your Strength modifier. You are proficient with your unarmed strikes.

Also Martial Arts for monks, and Claws for tabaxis and tortles deal with unarmed strikes.

All use Strength for the attack and damage roll, with the exception of the Martial Arts for monks, which accepts Dexterity too.

Should "unarmed strikes with these natural weapons" have the finesse and light traits, because wrestling and boxing are not only based on strength but also dexterity like wushu or bujutsu, and there is no reason to use two daggers but can’t do so with claws or fists, feets etc.? The monk still has more damage and would gain two-weapon fighting with its body. So it would not unbalance in game, but give the tabaxi and tortle non-throwable natural daggers.

How should Duergars enlarge power and Squeezing into cramped spaces interact?

The actual RAW rule for the Duergar’s enlarge is:

Enlarge (Recharges after a Short or Long Rest). For 1 minute, the duergar magically increases in size, along with anything it is wearing or carrying. While enlarged, the duergar is Large, doubles its damage dice on Strength-based weapon attacks (included in the attacks), and makes Strength checks and Strength saving throws with advantage. If the duergar lacks the room to become Large, it attains the maximum size possible in the space available.

So, in abbreviated form, I see these effects while enlarged:

  • Status Change: Size is Large.
  • Benefit: For Strength based attacks, double the base weapon damage dice.
  • Benefit: Advantage on Strength checks and Strength save.
  • Special Condition: If not enough room to become Large, becomes maximum possible size instead.

It is this last point, and especially how it interact which with the 3 others, that we are confused about.

Also, here is the rule for cramped spaces:

SQUEEZING INTO A SMALLER SPACE

A creature can squeeze through a space that is large enough for a creature one size smaller than it. Thus, a Large creature can squeeze through a passage that’s only 5 feet wide. While squeezing through a space, a creature must spend 1 extra foot for every foot it moves there, and it has disadvantage on attack rolls and Dexterity saving throws. Attack rolls against the creature have advantage while it’s in the smaller space.

Given the situation as detailed in my question above (i.e. duergar decides to enlarge while in a 1 square wide corridor i.e. a 5 feet wide corridor), what should actually happpens, as per RAW?

[A] There is not enough space for the Duergar to actually enlarge to Large size, so the Duergar remains Medium size. Thus, as a Medium creature, it is not Squeezing into a Smaller space. Also, given that it is not Large, it doesn’t get it’s other Duergar enlargement’s damage and Strength benefits.

or

[B] The duergar enlarges somewhat to the maximum possible for Medium creatures, becoming noticeably larger but still "barely under" the limit for actually becoming squeezed (kinda like how a Goliath is still a Medium creature but still has a much bigger "build" anyway). But, as there is not enough space for the Duergar to actually truly enlarge to Large size, thus the Duergar remains a Medium size creature. Thus, as a Medium creature, it is not Squeezing into a Smaller space. However, the Duergar still gets all of his other bonuses from his enlargement (weapon damage and strength advantage), because those benefits are dependent upon the activation of the enlargement power, not on the duergar effectivey really becoming Large size.

or

[C] The duergar enlarges to Large size because it is possible for him to do so anyway: "it attains the maximum size possible in the space available" meaning that it is indeed posssible for a Large creature to exist in a 5-feet wide tunnel, despite the cramped conditions. Thus, the "maximum possible" to exist there is not "Medium", but it is instead "Large + squeezing". Not only does the duergar gets all of his bonuses from being enlarged, but it is also now Squeezing into a smaller space.

So, which is it? DM + players each have their own ideas on how to resolve this, seemingly on opposite ends of the spectrum. We argue the duergar should become squeezed as in [C], thus getting the penalties. Aka "This is really a bad dungeon design for them, all the rooms and corridors where there could be any battle should instead be made to take advantage of their Large size in combat instead". DM is the complete other way as you will see below.

Of course the DM ultimately decides, but we wanted to know what the actually RAW ruling is because a lot more duergars are going to be fought over the next few sessions, we have just entered into a huge dungeon and that dungeon is really seeminggly going to be a big dungeon crawl full of tiny tunnels and tiny rooms, full of duergars all the way to the bottom level.

But it actuallly goes further than even that.

The party is actually good at being fast & sneaky, so the PCs can relatively easily surprise the duergar while they are in a tiny room, to immediately enter the room and position ourselves so that the duergars simply do not have any free 10×10 feet area for them to easily become fully Large size. So, what happens then, when the duergar go into enlargement?

[D] Exactly the same thing as in the 5-feet wide tunnel above (either [A] or [B] or [C]). The PCs are treated as much as "solid obstacles" as the walls are. That is the players’ opinion on things.

or

[E] As the duergar enlarges, it also automatically pushes away any PCs into nearby empty spaces. The player decides which way he is pushed back (this is not a Shove Action made on purpose, after all), with a Strength Save to try to resist the push (duergar ability DC being 8 + 2 Proficiency + 2 STR = DC 12). If pushed and the only way to be pushed back is right into a hole, the PC falls, with a DC 12 Dex Save allowed to hang onto the ledge. This is a "middle ground" approach we tried to negotiate.

or

[F] Same as E, however since the enlargement is "magical" in nature, it pushes back so strongly that it is the duergar’s space that always takes priority, forcing PCs to be the ones pushed not only backways but even sideways too. Basically it works EXACTLY like a free multi-target Shove that is always automatically succesfull, without any opposing resisting check. So in other words it is the duergar who chooses which way we get pushed, even to the point of being forced to end up with 2 or more PCs forced into the same space. Thus, not only does the duergar end up with zero penalty for cramped space, but it is the PCs that end up being the ones that are all squeezed up! And if 3 or more PCs are forced into the same space, they get squeezed so much so that they automatically fall Prone, can’t attack at all, and have to Crawl to get out of the "body pile", provoking an Attack of Opportunity in the process. That is the DM’s stance.

The DM retroactively said that that dungeon has lots of small tunnels and rooms on purpose: he actually built that duergar-built "fortress dungeon" fully with "Interpretation F" in mind.

Also, the DM made the duergar enlarge power "free" to use and not an "Action" to use. Basically, duergar can grow enlarged and immediately attack on their same turn. Monster Manual however seems to say otherwise? Anyway, that dungeon is full of very deadly traps that the perma-invisible duergars (they constantly short rest all day long to keep invisible, because you can somehow maintain your Concentration fulll time during a short rest?) just enlarge at exactly the right moment in order to auto-shove us into ridiculous damage traps (up to acid and lava pits and non-lootable vorpal wall blades and also "mordenkainen disjunction" traps), with of course being allowwed to make an attack too (making falling into a pit trap, or taking the trap’s weapon damage a second time "as you get whacked all around inside the swift moving blades of the trap even more", becoming a neear certainty (DM makes the save DC based on the total damage they deal). Basically: Big Ouchie.

While a DM is allowed to run his campaign as he sees fit, he also insists that he is applying the rules "by the book", so… as per RAW, is he really in any way in the right here? Please help?

Thanks!