Why is my select is 2 times faster than objects.get(name=domain)? Why is there so much overhead?
d = Domain.objects.get(name=domain) [...] Checked 90000 domains at 1434 domain/s Now if instead I just do: cursor.execute("""SELECT id,name from "DNS_domain" WHERE name='%s' """ % domain) row = cursor.fetchone() Checked 90000 domains at 3659 domain/s I am using django latest trunk and postgresql 8.2 The domain relation contains 180 million records. class Domain(models.Model): name = models.CharField("domain name", maxlength=255, unique=True) source = models.ForeignKey(History, verbose_name="Source") CREATE TABLE "DNS_domain" ( "id" serial NOT NULL PRIMARY KEY, "name" varchar(255) NOT NULL UNIQUE, "source_id" integer NOT NULL REFERENCES "Log_history" ("id") DEFERRABLE INITIALLY DEFERRED ); Thanks, K. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---