Top "Query-optimization" questions

For questions about making database queries run faster.

Which SQL Server field type is best for storing price values?

I am wondering what's the best type for a price field in SQL Server for a shop-like structure? Looking at …

c# sql-server linq-to-sql database-design query-optimization
PL/SQL Performance Tuning for LIKE '%...%' Wildcard Queries

We're using Oracle 11g database. As you may or may not know, if you use wildcard query with "%" in front …

sql oracle indexing query-optimization
Fastest way to find string by substring in SQL?

I have huge table with 2 columns: Id and Title. Id is bigint and I'm free to choose type of Title …

sql sql-server full-text-search query-optimization sql-server-2008-r2
How to optimize slow query with many joins

My situation: the query searches around 90,000 vehicles the query takes long each time I already have indexes on all the …

mysql performance join query-optimization
How to search millions of record in SQL table faster?

I have SQL table with millions of domain name. But now when I search for let's say SELECT * FROM tblDomainResults …

sql query-optimization sql-like
MySQL fetch time optimization

oI have a table with 2 millions of registers, but it will grow much more soon. Basically this table contains points …

mysql query-optimization database-performance
Using COLLECT STATISTICS in Teradata

In Teradata I can use a statement like ... collect statistics on my_table column(col1) This will gather stats on …

sql database query-optimization teradata
Downsides to "WITH SCHEMABINDING" in SQL Server?

I have a database with hundreds of awkwardly named tables in it (CG001T, GH066L, etc), and I have …

sql sql-server query-optimization schemabinding
MYSQL query - getting totals by month

http://sqlfiddle.com/#!2/6a6b1 The scheme is given above.. all I want to do is get the results as …

mysql query-optimization
Is possible to reuse subqueries?

I'm having some problems trying to perform a query. I have two tables, one with elements information, and another one …

sql subquery query-optimization