Rollo, Dan wrote:
A thought: Is it possible to just reverse the order of the fields in the
Primary Key?
As in change:
PRIMARY KEY (message_name, repository_name),
to:
PRIMARY KEY (repository_name, message_name),

In many databases, I think this allows the index (PK) to be used to optimize
queries that filter by the repository_name, as well as those that use both
repository_name and message_name. (With the old order, queries filtering by
repository_name would not use the index).
Good point... checking over all the SQL statements, everytime we query with message_name, we also query with repository_name. So with the index/primary key order reversed, the queries that just use repository_name can benefit from the single index.

--
Serge Knystautas
Loki Technologies
http://www.lokitech.com


--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to