This is a slightly moot point, though; Django defines the admin logobject_id using a TextField, and changing this would be a big
backwards incompatibility.
Shouldn't something be changing that = into a LIKE (and escaping LIKE
metacharacters in the parameter)?
I don't know why a user should have <queryset>.filter(object_id='1')
fail, as that breaks the ORM abstraction. Maybe that's not what you're
suggesting?
Richard
The indexing that Oracle is supporting is 'index-on-expression'. DB2
also supports that, but it isnt enabled for character long columns,
since they hadnt had a request for that. I talked to the DB2 server
folks about these use-cases and they have agreed to support this via
index-on-expression shortly. For the immediate needs, Rahul is going
to look at supporting this via 'hidden' columns - Whenever there is a
text field with an index specified, the backend will create a hidden
and generated column (poplated with first X chars of the text field).
The index will be created on this hidden column. When there is a
lookup by value, the backend will actually do the lookup on the hidden
indexed column. - you see any blockers to this ?
BTW, index is not turned ON on LogEntry.object_id. Do you feel this
use-case usage is low to warrant that ?
regards
Mario
I'm not sure what you're asking me. "Blockers" of what?
I know almost nothing about DB2; I know only slightly more about
Oracle. I can only advise you on what Django does. In this case, the
code tells you everything you need to know: Django needs to be able to
issue the following query:
action_list = LogEntry.objects.filter(
object_id = object_id,
content_type__id__exact =
ContentType.objects.get_for_model(model).id
).select_related().order_by('action_time')
As long as you can satisfy that requirement, you've done everything
you need to do.
> BTW, index is not turned ON on LogEntry.object_id. Do you feel this
> use-case usage is low to warrant that ?
I can't say the lack of an index on that field has been a performance
problem on any site I've managed, and I don't recall seeing any
reports on the mailing list or Trac that indicate that it has caused a
problem for anyone else.
Yours,
Russ Magee %-)
I meant, for sure we know that the backend can switch the lookup to
the hidden column (from the original column) by overriding -
'field_cast_sql(self, db_type):'
The backend also needs to execute the SQL to create the hidden column
during Django's index creation process. Rahul hasnt yet started
digging where to add that. The 'Blocker' question was if uphead anyone
knew that would be problematic for the backend to do ?
regards
Mario