Skip to content

SQL inner join and where performance comparison

If we have 2 tables, tableA (with column1, column2) and tableB (with column1, column2), what’s the difference between the following two queries? Which one has better performance? What if we have indexing for both tables? Query #1: Query #2: Answer Both will perform equally. One is an ansi style and the …

Replace conditional subquery in Order By (Performance consideration)

I have a ratings table (t2) I’m using to sort queries by lower_bound DESC. The problem is, the default value of lower_bound has to be null or 0. When a rating occurs, the row is updated with Wilson’s rating algo. This means that new entries get ordered before all other entries in a lower_bound DES…