Dynamic LIMIT based on query time

I’m writing scripts in Python for cleaning up a database. It mainly is finding and deleting billions of rows of data based on some logic. I have it running in a loop with a LIMIT that will run until there are no longer any rows affected by a DELETE. It is running on a production database that gets different load during different times of the day, so the time to do these DELETE queries varies based on the load. I don’t want to lock up any tables by running a large DELETE, so I’ve been trying to benchmark the query times for different LIMITs. I found these times varied a lot based on the time of the day, so I started looking into making a dynamic LIMIT that increases or decreases based on the query time. It will increase or decrease between a floor and ceiling based on the the last query time. So the basic logic is

if QUERY_TIME < DECREASE_TIME and LIMIT < MAX_LIMIT:   LIMIT = LIMIT * 10 elif QUERY_TIME > MAXIMUM_TIME and LIMIT < MIN_LIMIT:   LIMIT = LIMIT / 10 

My question is if this is a good strategy? I’m still learning a lot of optimizations for database work, so I’m not sure if this is a common strategy or what pitfalls I may encounter.

What is the limit to a Glyph of Warding’s trigger?

So, say you are a wizard 15/warlock 2. You have the Lance of Lethargy invocation, which pushes an enemy you target with eldritch blast and hit back 10 feet. Say you put a demiplane entrance ~5 feet behind the enemy you target with it. When you hit, you throw the enemy in. Before all this, you had put a Glyph of Warding in there on one of the surfaces. What would be the limit to the trigger for this? Would it be forced to be touch or proximity, or could you base it off something like hostility towards the caster?

Page 245 of PHB

… When you cast this spell, you inscribe a glyph that later unleashes a magical effect … You decide what triggers the glyph when you cast the spell. For glyphs inscribed on a surface, the most typical triggers include touching or standing on the glyph, …

The key word here is typical. Based on Google’s definition, the informal definiton of typical is

showing the characteristics expected of or popularly associated with a particular person, situation, or thing.

This means, if my assumption is true, that the triggers in the PHB are only the most common ones. Other than the one about being forcibly at maximum 10 feet in diameter in the PHB, I cannot see a limit. Though I probably should assume this would all be DM discretion, (and I know that I sound like a broken record here) but could the trigger be hostility toward the caster, or something else, like being a specific race, gender, from a specific place, etc., or would it be forced to being something from the PHB?

Left-hand limit and Right-hand limit of a function


There is a function given by $ $ f(x)=\begin{cases} x\sin{\frac{1}{x}}, & x \ne 0 \ 0, & x=0. \end{cases}$ $ Find the left-hand limit and right-hand limit and the continuity of this function at $ x=0$ .

This is what I tried:

(Left-hand limit at $ x=0$ ) =$ $ \lim_{x\to 0^-}f(x)=\lim_{h\to 0} f(0-h)$ $ $ $ \lim_{h\to 0} f(-h)=\lim_{h\to 0} (-h)\sin(\frac{1}{-h})$ $ $ $ \lim_{h\to 0}(-h)\cdot\frac{1}{-h}\frac{\sin(\frac{1}{-h})}{\frac{1}{-h}}=1$ $ I did this same process for the right hand limit at $ x=0$ and also got $ 1$ .

However, the book I got this from puts the working as such…

(Left-hand limit at $ x=0$ ) =$ $ \lim_{x\to 0^-}f(x)=\lim_{h\to 0} f(0-h)$ $ $ $ \lim_{h\to 0} f(-h)=\lim_{h\to 0} (-h)\sin(\frac{1}{-h})=\lim_{h\to 0} h\cdot\sin(\frac{1}{h})$ $ $ $ 0\times(\text{ an oscillating number between -1 and 1}) = 0$ $ The same was done for the right-hand limit and it was concluded that $ f(x)$ is continuous at $ x=0$ and the value of its limit is $ 0$ .

I know that the graph of the function gives $ 0$ at $ x=0$ . But I don’t understand whats wrong with my working. Please explain

If I arrive in the UK, and then head to mainland Europe, does my Schengen visa 90 day limit start when I arrived in the UK, or mainland Europe?

As the UK is technically still a member of the EU, I just wanted to be sure of this before booking travel arrangements.

The idea is to arrive in the UK and stay there for 2-4 weeks, and then afterwards relocate to and stay in mainland Europe for another 80-90 days. Is this possible? Or would I be effectively limited to 70 days in the EU after staying for example 20 days in the UK?

Thanks so much for any help.

Find limit for sequence $(\frac n{n+1})_{n=1}^{\infty}.$

Need help in getting limit of sequence. This question is taken from section 3.2.1 of Chapter 3 of the CRM series book by MAA: Exploratory Examples for Real Analysis, By Joanne E. Snow, Kirk E. Weller.

I request to vet attempt; as well help to find the solution.

It is not solvable as L’ Hopital’s rule applies for $ \frac 0 0 $ or $ \frac {\infty}{\infty}$ cases alone, & the form is $ \frac 1{\infty}$ .

Q.3. Identify limit of Seq. 3 using calculus. $ $ (\frac n{n+1})_{n=1}^{\infty}$ $

Let, $ f(n) = (\frac n{n+1})_{n=1}^{\infty}$ , need find $ f'(n)\approx\frac{\Delta y}{\Delta n}= \lim_{\Delta n \to0 } (\frac{f(n+\Delta n)-f(n)}{(n+\Delta n)-n})_{n=1}^{\infty}$

$ = \lim_{h\to0 }(\frac{f(n+h)-f(n)}{h})_{n=1}^{\infty}$

$ =\lim_{h\to0 }(\frac{\frac {n+h}{n+h+1}-\frac n{n+1}}{h})_{n=1}^{\infty}$

$ =\lim_{h\to0 }(\frac{\frac {(n+h)(n+1) -(n)(n+h+1)}{(n+h+1)(n+1)}}{h})_{n=1}^{\infty}$

$ =\lim_{h\to0 }(\frac{\frac {(n^2+n+nh+h) -(n^2+nh+n)}{(n^2+n+nh+h+n+1)}}{h})_{n=1}^{\infty}$

$ =\lim_{h\to0 }(\frac{\frac {h}{(n^2+nh+2n+1)}}{h})_{n=1}^{\infty}$ $ =(\frac {1}{n^2+2n+1})_{n=1}^{\infty}$