Skip to content

Tag: indexing

SQLalchemy specify which index to use

Is there a way in SQLalchemy to tell the query which index to use? The reason I need this is that the SQL queries it generates use the “wrong” index – there exists an index for exactly the two fields that I have and it doesn’t use it. Thanks! Answer I think you can use with_hint() for …

Creating index if index doesn’t exist

I have a problem creating an index with the advantage database server if it doesn’t exist with a sql query. My query looks like this: So I don’t use FullTextSearchIndizes,because it is a integer field. Otherwhise it would look like this: So, my only problem is how do I get the indices. I’ve …

Index for nullable column

I have an index on a nullable column and I want to select all it’s values like this: In the explain plan I see a FULL TABLE SCAN (even a hint didn’t help) Does use the index… I googled and found out there are no null entries in indexes, thus the first query can’t use the index. My ques…

Indexes and multi column primary keys

In a MySQL database I have a table with the following primary key In my application I will also frequently be selecting on item by itself and less frequently on only invoice. I’m assuming I would benefit from indexes on these columns. MySQL does not complain when I define the following: But I don’…