![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| Database Database problems or need to ask a question? maybe something to do with sql injections or a database software question. Database topics cover MySQL, PostgreSQL, Oracle, SQL Server or anything else related to databases. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| Using the (datelast, status) index would probably work, but unfortunately I also have an index on ('status','somethingelse') in the table, which I need for another query. Since this index's cardinality is lower than the one of (datelast, status), MySQL chooses the wrong index and I still have the same problem. Any idea how I can force MySQL to use a certain index? | |||
| | #2 | ||
| On Tue, 05 Jun 2007 07:06:53 -0700, nk <nkoelling@gmail.com> wrote: >Using the (datelast, status) index would probably work, but >unfortunately I also have an index on ('status','somethingelse') in >the table, which I need for another query. Since this index's >cardinality is lower than the one of (datelast, status), MySQL chooses >the wrong index and I still have the same problem. > >Any idea how I can force MySQL to use a certain index? SELECT blabla FROM table USE INDEX myindex WHERE ... or if it's really not willing to use it : SELECT blabla FROM table FORCE INDEX myindex WHERE ... | |||
| Featured Websites | ||||
|
![]() |
| Tags: indexes, sorting |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using two indexes on the same table | jfgroff@gmail.com | Database | 3 | 07-01-2007 9:28 PM |
| Point me to some references for Sorting | Marty Meyers | Database | 2 | 07-01-2007 7:31 PM |
| Sorting MySQL data with PHP | Sundial Services | PHP | 0 | 07-01-2007 5:29 PM |
| joining tagbles and sorting | louiss | PHP | 1 | 07-01-2007 4:14 PM |
| Featured Websites | ||||
|