Re: objects.get overhead: at least 2 times slower than a select

2007-08-27 Thread Kugutsumen
d SP-GiST which should enable patricia indexes. On Aug 27, 10:19 pm, John Melesky <[EMAIL PROTECTED]> wrote: > On Aug 27, 2007, at 2:05 AM, Kugutsumen wrote: > > > cursor.execute("""SELECT id,name from "DNS_domain" WHERE name='%s' > > "

objects.get overhead: at least 2 times slower than a select

2007-08-27 Thread Kugutsumen
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 9 domains at 1434 domain/s Now if instead I just do: cursor.execute("""SELECT id,name from "DNS_domain" WHERE name='%s' """ % domain) row = cu

Best wait to avoid collision before inserting a record?

2007-08-26 Thread Kugutsumen
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" ( "