[dev] SQL updates (was Re: Redundant index in table mnemo_memos?)
Chuck Hagenbuch
chuck at horde.org
Mon Aug 21 22:46:08 PDT 2006
Quoting Duck <duck at obala.net>:
> whups_db_version
> I grep the sources but I didn't see that is used anywhere.
Killed.
> whups_ticket_owners
> The has two indexes. Right, but the logic should be: an unique index composed
> from the two column like in whups_queues_users.
Should it? What I always run across is that MySQL will only use one
index per table in a query. It'll pick the best one. Composites only
count if the relevant column is first... but it does work best if
you're querying on _both_ fields in the index.
Looking at the code, most of the time we query on both ticket_id and
ticket_owner; sometimes just on ticket_id. So does changing it to use:
PRIMARY KEY (ticket_id, ticket_owner) ... sound right?
> Tables without indexes:
> whups_attributes
> whups_types_queues
> whups_users_searches
> whups_tickets_listeners
Patch? Suggested fields to index?
-chuck
--
"we are plastered to the windshield of the bus that is time." - Chris
More information about the dev
mailing list