Facing a strange issue that a query runs incredibly slow (worse) when scalar variables are used as parameter.  Actual Query (Faster) - 9 secs  select   sum(v.sale_value) as col_0_0_,   sum(v.vat_value)  as col_1_0_,   sum(v.sale_fcy)   as col_2_0_,   sum(v.vat_fcy)    as col_3_0_ from my_view v where v.company_id = 1 and v.filing_year = 2018 and v.filing_month = 1;   Parameterized Query (Worse) - 16 mins  DECLARE @P0 int, @P1 int, @P2 int; SET @P0 = 1; SET @P1 = 2018; SET @P2 = 1; select   sum(v.sale_value) as col_0_0_,   sum(v.vat_value)  as col_1_0_,   sum(v.sale_fcy)   as col_2_0_,   sum(v.vat_fcy)    as col_3_0_ from my_view v where v.company_id = @P0 and v.filing_year = @P1 and v.filing_month = @P2;   Execution times for both queries were calculated by executing in command line client (IntelliJ Database console).  Query with this scalar variable is generated by our Hibernate Application as we've used setParameter(String name, Object value) to set the param values.  First, we suspected issue in hibernate generated query, but narrowed down to SQL Server query execution after identifying it as parameterized query using sys.dm_exec_cached_plans. Does query optimiser get confused when scalar variables are used?  In java code, we're setting the values as query parameters. In sys.dm_exec_cached_plans, the actual query is:  (@P0 int,@P1 int,@P2 int)select &lt;columns&gt; from my_view v where v.company_id= @P0 and v.filing_year= @P1 and v.filing_month= @P2   Note: my_view is pretty complex (nested views, group by, joins, order by, where clause...). We tried to compare the execution plans, but they're incredibly huge We are looking into it but might take some time.  If I run the slow query with OPTION (RECOMPILE), it executes in 9 secs.  SQL Server Version  Microsoft SQL Server 2012 - 11.0.2100.60 (X64)      Feb 10 2012 19:39:15      Copyright (c) Microsoft Corporation     Express Edition (64-bit) on Windows NT 6.2 &lt;X64&gt; (Build 9200: ) (Hypervisor)
[Salutations]  (check one)  [ ] Well trained professional, [ ] Casual reader, [ ] Hapless wanderer,   I have a (check all that apply)  [ ] query [ ] stored procedure [ ] database thing maybe     that was running fine (if applicable)   [ ] yesterday [ ] in recent memory [ ] at some point    but is suddenly slower now.  I've already checked to make sure it's not being blocked, and that it's not the victim of some long running maintenance task, report, or other out of band process.  What is the problem, what should I do, and what information can I provide to get some help?  [*Insert appropriate closing remarks*]
Calculate daily sums using python pandas How to update textbox in form1 from form2? So I am on Minecraft playing on my friends world (Not server). However, they won't go online for no reason. I want to go continue my work on that world and not start brand new on survival again. I've already made a lot of progress and would not like to lose it, can somebody help? I've already tried to get answers but they are either too complicated or for servers like IP. I've installed Ubuntu 14.04 and I'm experiencing a fuzzy/blurry screen and bad support for multiple screens.  I realized that Ubuntu installs nouveau as default, but I need to install nvidia drivers, so I tried this:   sudo apt-add-repository ppa:ubuntu-x-swat/x-updates apt-get update apt-get install nvidia-current apt-get upgrade       Now that nvidia is installed, you need to blacklist the nouveau driver   so it don’t pop out when you will reboot. Create or edit the following   file:  nano /etc/modprobe.d/blacklist-nouveau.conf       …and add these lines at the end:  blacklist nouveau blacklist lbm-nouveau options nouveau modeset=0 alias nouveau off alias lbm-nouveau off    I checked via the software &amp; updates if nvidia driver got installed successfully, and it says the driver installed is nvidia 304.117  I then tried to run:  lshw -c video | grep 'configuration'   and the result is that the driver is still nouveau:  configuration: driver=nouveau latency=0   So how do I install and use the nvidia drivers? Why is there free space at the end of NTFS Partitioned Drives? I've been wondering this for a while, why is there free space at the end of a drive that was formatted to NTFS in windows?  You can only see the unallocated space in Linux. So why is it there? Does it serve a purpose? Element of, subset of and empty sets Proof of property of abelian group I want to show that $\forall x$,$y\in G$, $(xy)^2=x^2y^2 \iff G $ is an abelian group.  Proof of the backward direction seems easy enough:  Assume $G$ is an abelian group. Then consider $(xy)^2=(xy)(xy)$. By associativity, $(xy)(xy)=xyxy$. Since $G$ is abelian, $xyxy=xxyy=x^2y^2$.   Proof of the forward direction I attempt by contrapositive:  That is, assume $G$ is not an abelian group. Then, consider $(xy)^2=xyxy$ as above. Yet, $xyxy\neq xxyy=x^2y^2$ since we no longer have commutativity.  Is this proof by contrapositive completely correct? Given n distinct objects, there are $n!$ permutations of the objects and $n!/n$ "circular permutations" of the objects (orientation of the circle matters, but there is no starting point, so $1234$ and $2341$ are the same, but $4321$ is different).  Given $n$ objects of $k$ types (where the objects within each type are indistinguishable), $r_i$ of the $i^{th}$ type, there are   \begin{equation*} \frac{n!}{r_1!r_2!\cdots r_k!} \end{equation*}  permutations.  How many circular permutations are there of such a set? Let $G$ be abelian, $H$ and $K$ subgroups of orders $n$, $m$. Then G has subgroup of order $\operatorname{lcm}(n,m)$. Let $G$ be abelian, $H$ and $K$ subgroups of orders $n$, $m$. Then G   has subgroup of order $\operatorname{lcm}(n,m)$.   This is a statement that my lecturer mentioned in my (beginners') Abstract Algebra class. I'm not sure I understand why it's true.  What I have so far: Use the abelian group structure theorem on $\langle H, K\rangle$ (finite group generated by $H$ and $K$). Then $\langle H,K\rangle=C_{a_1}C_{a_2}\dotsm$ and $n, m |\langle H,K\rangle$. Which means it's also true that $\operatorname{lcm}(n,m)|\langle H,K\rangle$. Can I leverage this to say there's a subgroup of order $\operatorname{lcm}(n,m)$? I saw her dance/dancing? I saw a flash of lightning strike/striking? I caught her steal/stealing? I'm trying to solve    So far I've done the first part, evaluating the summation ;  where a is just n. I'm not sure where to go from here or what it even means deduce the second summation. I understand that the summation of simply $$\sum\limits_{k=0}^n\cos(kx)$$ is derived from looking at the real part of  $$\sum_{k=0}^n{\rm e}^{ikx} $$I'm guessing they want me to see how the second summation in the question is defined by 'playing around' with the original? Dimensional Tolerance for US Standard NEMA 1-15 Plugs I am trying to find the dimensional tolerance on US electrical plugs. I have tried looking online, but I have only been able to find that they are called , and have found the picture below showing length and height for the male connector (but not width of the male prong), and I haven't been able to find dimensional tolerances anywhere.     I ask here because I'm assuming there's a US code that governs electrical plugs, but I can't seem to find the standard anywhere. Is there a convenient way to place a figure* at the end of the current page instead of taking up the entire next page in the twocolumn environment? Placement modifiers [Hb] do not work. In particular, when $x=y=z$ isn't the above expression equal to 1 and not -1? How to install OneDrive on ubuntu 13.10 x64 Will Determinism be ever possible? $A^m\hookrightarrow A^n$ implies $m\leq n$ for a ring $A\neq 0$ I'm trying to prove that if $A\neq 0$ is a commutative ring and there is an injective $A$-module homomorphism $A^m\hookrightarrow A^n$ then $m\leq n$ must necessarily hold.    This is exercise 2.11 from Atiyah and MacDonald's Introduction to Commutative Algebra, but unfortunately all the solutions available online are either very sparse with regard to this question or seem to use (to my surprise) a generalized version of Cramer's rule. Is there perhaps some other "cleaner" approach to solving this problem? 'He don't have knowledge ' vs 'He doesn't have knowledge' What is the correct pronunciation of the word "solder"? I have been listening to a podcast where the host pronounces the word solder as "sodder" or "sod-der", even "saw-der". Same thing happened when the lecturer of one of my EE classes pronounced the word solder. As for me I pronounce the word solder as "sole-der" with a distinct L and a longish O. I have run a multiple linear regression using stepwise regression to select the best model, however the best model returned has a non-significant variable. When I remove this the AIC value goes up indicating the model without the significant variable is a worse fit. Should I remove the non-significant predictor or should I leave it in as it is a better model?