I found a unique index on (RetailerID, ID) in our database.  The ID column is the primary key so it's already uniquely indexed.  I can't see how an index on (RetailerID, ID) could help when looking up an individual record by RetailerID and ID (or just ID).  I suspect it might be helpful when querying all the IDs under a particular RetailerID, since it covers such a query.  Is that true?  But then why not just make the index on RetailerID include ID?  Perhaps the unique index on (RetailerID, ID) covers the query in the same way but performs better as a result of being a unique index.    As I said, there's a unique primary clustering key on ID alone.  There's also a unique index on (RetailerID, ID). Since ID is already unique, querying where RetailerID = x and ID = y shouldn't be any more efficient than simply querying where ID = y.  (ID) is unique and (RetailerID, ID) is unique, so ID is associated with at most one RetailerID.  Therefore, if a predicate has ID, then including RetailerID in the predicate is redundant.  The clustered index would always be faster.  An index on (RetailerID, ID) could be helpful for a query where the predicate is just on RetailerID and the select is on just ID, because it would cover the query, but for queries where ID is in the predicate, RetailerID in the predicate is redundant, and since it has no other included columns, it would be less-efficient than the clustered index when selecting any column other than ID.  That's why I'm not seeing the point of this index, given the predicates used (which always involve ID).
I inherited a project using SQL Server 2005.  Recently there were some performance problems and I started looking at the indexes, and found  _dta_index_survey_25_135059617__K1_K10_K19:     id ASC, sent_date ASC, group_id ASC   and  _dta_index_survey_21_364632442__K18_K1_K2_K9:     group_id ASC, id ASC, campaign_id ASC, sent_date ASC   which appears to be generated by some kind of automatic performance tuning tool.  I think SQL Server comes with something like that but I'm not familiar with it.  Anyway, id is the primary key, and what I'm trying to understand here is how it could possibly be beneficial to include the primary key within a secondary index... because you have to have the leftmost pieces of information to use an index and if you know id then you've got the row anyway.  Can someone explain why a tool would have generated these indexes and if there's any point in keeping them?  Just because the indexes are getting used doesn't mean they're a good design.  SQL Server is using the wrong indexes lately, and I'm trying to determine why. More specifically, queries against this table that ran in milliseconds a month ago are now taking multiple seconds.  The table is huge (4M rows), and growing steadily, but at the same pace it's been going at for years.  Almost every query joins across group_id or campaign_id.  Often both.  The application almost never specifically selects or sorts by the PK, but I could see how ID could be useful when comparing or merging lists of IDs within the database engine.  ... But id is also an identity column, and an index holds lists of row ids, so it still seems redundant to have the ID in the key when it's also in the index "buckets".  And the additional fields could still be covered by the index without being part of the key.  I discovered that (id, sent_date, group_id) hardly ever gets read.  Meanwhile (group_id, id, campaign_id, sent_date) is one of the hottest indexes.  Next I found that an index which I thought was pretty reasonable (campaign_id, sent_date, group_id, id) also has a index_columns_include of every other column in the table, and occupies more space than the primary clustered index on id!  (but it's also pretty hot...)  Surely I can replace it with a simple (campaign_id, sent_date, group_id)?
How to download a whole FTP site using command line? I need to download an FTP site (a web site source code actually) containing a very high quantity of relatively small files (downloading it with FileZilla took more than a day, but I believe it could be downloaded much faster if many files were downloaded at once). Unfortunately there is no SSH access to the site and no way to archive the files on the server side.  So at least the question is how to download a whole FTP site into a folder using command line tools. A better it'd be if the download could be parallelized by downloading many files simultaneously instead of one by one. Solve $u_t=u_{xx}+u_x$ Is the following statement provable? Deriving the speed of the propagation of a change in the Electromagnetic Field from Maxwell's Equations I've been told that, from Maxwell's equations, one can find that the propagation of change in the Electromagnetic Field travels at a speed $\frac{1}{\sqrt{\mu_0 \epsilon_0}}$ (the values of which can be empirically found, and, when plugged into the expression, yield the empirically found speed of light)  I'm really not sure how I would go about finding $v = \frac{1}{\sqrt{\mu_0 \epsilon_0}}$ simply from Maxwell's equations in the following form, in SI units --  $$\nabla \cdot \mathbf{E} = \frac {\rho} {\epsilon_0}$$  $$\nabla \cdot \mathbf{B} = 0$$  $$\nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}} {\partial t}$$  $$\nabla \times \mathbf{B} = \mu_0 \left( \mathbf{J} + \epsilon_0 \frac{\partial \mathbf{E}} {\partial t} \right)$$  Is what I believe true? (that the speed of propagation is derivable from Maxwell's Equations)  If not, what else is needed?  If so, can you provide a clear and cogent derivation? Use the view from other cameras in the scene as VideoTexture in Cycles I have a scene with monitors that display video from cameras in the same scene (or other scenes, but all of them are linked i.e., same objects in the scene). The cameras shown on the monitors do not view the monitors, so no looping should occur.  I found  that shows how to get the effect in the Game Engine.  I would like to do this in cycles.  Essentially I would like a material input node that corresponds to the output of the composition of a particular scene. The incoming image should honor the render settings of the particular scene and any compositing applied to it.  The Render Layer node does not appear to honor the resolution or compositing settings of the scene it comes from, and is not available to apply as a texture in the material node editor (that I can find).  I understand that this could be done by rendering the animation from the various cameras, then applying that video as textures to the monitors, then rendering the camera of the monitors. That's super tedious if your making changes to the whole scene, and I don't want to do that. What's the @ in front of a string in C#? What program can be used to package software into one executable? I need to package an application into a single executable file (so that I don't have to install it, so that it will be portable).  Does anybody know what I can use to make a program portable? I can't retrieve my Facebook password I haven't been to my Facebook account in a while and I can't remember my password. When I try to have it reset, it goes to a security question, but I can't remember that either.    Is there anything I can do? Entire function $f$ such that $|f(z)| ≤ K |z|^3$ for $|z|\ge1$ and $f(z) = f(iz)$ for every $z∈C$ Let $f(z)$ be an entire function such that for some constant $K$ , $|f(z)| ≤ K$ $|z|^3&lt;$ for $|z|\ge1$ and $f(z) = f(iz)$ $∀z∈C$ , then which of the following are correct ?  (A)$ f(z) = Kz^3$ $∀ z∈\Bbb{C}$ (B) $f(z)$ is a constant function (C) $f(z)$ is quadratic function (D) No such $f$ exists   My attempt : I can deduce that since $f(z) = f(iz)$ and since $i^4=1 \implies f$ must involve only fourth powers of $z$ . Hence $f(z)=a_1z^4+b_1z^8+c_1z^{16}+ \cdots $-------(1)  Also for $|z| \ge 1 $: let C.   Then $|g(z)| = |f(z)|/|z^3| \le k$ => By the Cauchy estimate theorem we can prove that :  $f(z)/z^3$ is a constant function $= c $   $\implies f(z)=cz^3$ for $|z| &gt; 1$     ...........(2)  From (1) and (2) ; we get  there does not exist a function like this ?  My textbook answer says it's a constant function ? How can I view all my unaccepted questions across SE? Why is the Apps flash storage so high and how can it be reduced? This is the disk storage info:    This is the Applications folder info:    Why is the storage usage so high and how can it be reduced? This is on a MacBook Pro Retina 13" with OSX 10.9.5.  Edit: I had tried all the suggestions made by @user3439894 in his answer but didn't mention it before posting. How to zero out a drive? In Magic: The Gathering, the rules for a player losing in a multiplayer game are quite complex, so I'd like to try to understand them by example. I would be happy to ask each of these situations as a separate question if that is preferred, but they all seem related, and I would love to have one place to look up all of these answers.  Let's say I'm playing with two friends, Bob and Chloe, in a simple free for all. Unfortunately, I lose. When I lose, suppose the following:   I controlled an  which has exiled Bob's , does he get his bear back? I have a  on the stack targeting Chloe, does Chloe take the 2 damage still? Earlier in the turn I cast  to prevent damage to one of Bob's . If it later takes 3 damage, will that damage be prevented? Something I controlled gave Bob a 1/1 soldier token. What happens to the token? Something Chloe controlled gave me a 1/1 soldier token. What happens to the token? I had a  enchanting one of Bob's army of . What happens to the bear? I had also played  on Bob's final . What happens to the last bear? Chloe had  my . What happens to the Clone? Are there any other situations specifically addressed by the rules? Why aren't all the badges shown on the track menu? I like using the 'Track Badges' menu on my profile a lot (I know what you're going to say, I just have a knack for these things), but I keep noticing something a bit unusual.  Many of the Badges featured on the actual list do not get featured on this menu. For example, I've been hoping to be able to track progress for the Pundit badge (ten comments with score of five or more), but it doesn't show up in the menu.  Why not? Find $\lim_{n\to\infty}\frac{a^n}{n!}$ How do you debug PHP scripts? How do you debug PHP scripts?  I am aware of basic debugging such as using the Error Reporting. The breakpoint debugging in PHPEclipse is also quite useful.  What is the best (in terms of fast and easy) way to debug in phpStorm or any other IDE? How can i render the reflections i see in the Look Dev viewport in Blender 2.8 i'm finding blender 2.8 confusing and i'm relatively new to blender in general anyway. While looking at my model in the Look Dev view port i can see reflections.        However, when i render my scene in eevee (and cycles), the reflections aren't rendered     Is there something i'm doing wrong or an option i haven't enabled? Problem: Prove that $1^2+2^2+\cdots+n^2=\frac{n(n+1)(2n+1)}{6}$ for $n \in \mathbb{N}$.  My work: So I think I have to do a proof by induction and I just wanted some help editing my proof.  My attempt:  Let $P(n)=1^2+2^2+\cdots+n^2=\frac{n(n+1)(2n+1)}{6}$ for $n \in \mathbb{N}$.  Then $$P(1)=1^2=\frac{1(1+1)(2+1)}{6}$$ $$1=\frac{6}{6}.$$ So $P(1)$ is true.  Next suppose that $P(k)=1^2+2^2+\cdots+k^2=\frac{k(k+1)(2k+1)}{6}$ for $k \in \mathbb{N}$. Then adding $(k+1)^2$ to both sides of $P(k)$ we obtain the following: $$1^2+2^2+\cdots+k^2+(k+1)^2=\frac{k(k+1)(2k+1)}{6}+(k+1)^2$$ $$=\frac{2k^3+3k^2+k+6(k^2+2k+1)}{6}$$ $$=\frac{2k^3+9k^2+13k+6}{6}$$ $$=\frac{(k^2+3k+2)(2k+3)}{6}$$ $$=\frac{(k+1)(k+2)(2k+3)}{6}$$ $$=\frac{(k+1)((k+1)+1)(2(k+1)+1)}{6}$$ $$=P(k+1).$$ Thus $P(k)$ is true for $k \in \mathbb{N}$. Hence by mathematical induction, $1^2+2^2+\cdots+n^2=\frac{n(n+1)(2n+1)}{6}$ is true for $n \in \mathbb{N}$. Why Java needs Serializable interface? I installed Ubuntu alongside Windows but I did not disable secure boot as someone told me it could cause problems with boot loader. So when installation finished and I rebooted, the system went straight into Windows. I went to Ubuntu IRC Support and they told me to turn off the secure boot and reinstall Ubuntu. I did that but my system still boot into windows.  This is a picture of partitions on my system:    This is my first Ubuntu install on my new laptop. I followed everdaylinux guide to install it and I used something else option.