Related to the use of IN, but not an answer, I've found this series of
article from ExplainExtended to be super helpful in optimizing some of my
DB queries. These two are for MySQL, but the author has versions for
Postgres and SQL Server as well. I know this help is limited with an ORM,
but maybe
I'm curious how long manually running a single delete query with the
appropriate where clause would take. Surely there's a way to do that through
the Django ORM without having to drop into raw SQL?
That being said, there are limits to how long a given query can be, so the ORM
would have to do
I changed it to delete one row at a time and it's taking 3 minutes.
On Wed, Apr 24, 2013 at 6:38 PM, Setiaman Lee wrote:
> Larry,
>
>
> Avoid to use IN clause. I'd say to insert the events you want to delete into
> the temp table. You can put the session id or user id in
Larry,
Avoid to use IN clause. I'd say to insert the events you want to delete
into the temp table. You can put the session id or user id in temp table to
differentiate set of data from other users. Then do the delete by joining
the temp table to the Event_Message_ldx table. your sql might look
I have a table that has 2.5 million rows and 9 columns that are all
int except for 2 varchar(255) - i.e. not that big of a table. I am
executing this statement:
Event_Message_Idx.objects.filter(event_id__in=event_ids).delete()
Where event_ids has around 1,500 items in it. There is an index on
5 matches
Mail list logo