New answers tagged

0

See if this runs faster: SELECT n.ID, n.LATITUDE, n.LONGITUDE, wn.WAYID FROM ( SELECT ID, LATITUDE, LONGITUDE FROM `node` WHERE LATITUDE BETWEEN '49.558' AND '49.568' AND LONGITUDE BETWEEN '11.3395' AND '11.3495' ) AS n JOIN `waynode` AS wn ON n.ID= wn.NODEID ORDER BY wn....


3

Assuming your variables are always NOT NULL WHERE ( ReceiveDateTime < @DocOldestTreshold OR ( ReceiveDateTime < @DocNewestTreshold AND ReceiveDateTime < t.Treshold ) ) Is equivalent to WHERE ReceiveDateTime < @DocOldestTreshold OR ReceiveDateTime < LEAST(@DocNewestTreshold, t.Treshold) Which is ...


0

Some of those indexes seem to have a lot of included columns. A table definition will provide context into the width of these columns. What is the clustered index key? You need to look at the workload being run against this table. What queries are being executed, how often are they being executed, is this going to change in the future? I would probably ...


0

There is no automatic reindexing. What you are probably seeing is an exclusive lock on the right to extend the index (add a new 8 kB block to the end of it), not on the index itself. What tool are you using to observe these locks? Does it give a 'locktype' field or something similar?


1

Let's imagine a large table, and the index is essentially the rows numbered. And we want every 50th row via id IN (50,100,150,200, ...). Further, let's say that there are about 100 rows per block. If you do a table scan, it will read all the blocks. That scan will read a block, pick up 2 rows, move on to the next block, etc. By the time it finishes, it ...



Top 50 recent answers are included