Re: Speed of search question

2011-07-08 Thread Benedict Verheyen
On 7/07/2011 11:31, Marc Aymerich wrote:

> Hi Benedict,
> If you're concerned about the performance of your django apps, I
> recomend you this app:
> https://github.com/robhudson/django-debug-toolbar/commits/master/
> 
> Besides many other interesting things, It shows you the DB queries
> that your views perform and how many time takes.
> 
> 

Hi,

thanks this seems like a very usefull application !

Regards,
Benedict

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Speed of search question

2011-07-07 Thread Venkatraman S
On Thu, Jul 7, 2011 at 3:01 PM, Marc Aymerich  wrote:

> https://github.com/robhudson/django-debug-toolbar/commits/master/
>

DDT rocks. Btw, does this fork have any special features when compared with
the Master?

-V

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Speed of search question

2011-07-07 Thread Marc Aymerich
On Thu, Jul 7, 2011 at 8:15 AM, Benedict Verheyen
 wrote:
> On 6/07/2011 12:28, Malcolm Box wrote:
>> I think this should work:
>>
>> Calendar.objects.filter(appointment__owner = request.user)
>>
>> Try it and see.
>>
>> Malcolm
>>
>
> Thanks,
>
>
> I'll see if I can make a test script to test this.
> It's actually a good idea to put in a performance test of some sorts.
>

Hi Benedict,
If you're concerned about the performance of your django apps, I
recomend you this app:
https://github.com/robhudson/django-debug-toolbar/commits/master/

Besides many other interesting things, It shows you the DB queries
that your views perform and how many time takes.


-- 
Marc

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Speed of search question

2011-07-07 Thread Venkatraman S
On Thu, Jul 7, 2011 at 11:45 AM, Benedict Verheyen <
benedict.verhe...@gmail.com> wrote:

>
> I'll see if I can make a test script to test this.
> It's actually a good idea to put in a performance test of some sorts.
>


I have much complex relationships, and i dont see any peformance issues.

-V

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Speed of search question

2011-07-06 Thread Benedict Verheyen
On 6/07/2011 12:28, Malcolm Box wrote:
> I think this should work:
> 
> Calendar.objects.filter(appointment__owner = request.user)
> 
> Try it and see.
> 
> Malcolm
> 

Thanks,


I'll see if I can make a test script to test this.
It's actually a good idea to put in a performance test of some sorts.

Regards,
Benedict

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Speed of search question

2011-07-06 Thread Malcolm Box
On 6 July 2011 08:17, Benedict Verheyen  wrote:

>
> I have these models (not really but it's to explain my question :))
>
> class Calendar(models.Model):
>name = models.CharField(max_length=60)
>description = models.TextField(blank=True)
>appointment = models.ManyToManyField(Appointment,
> related_name='appointment_set')
>
> class Appointment(models.Model):
>name = models.CharField(max_length=60)
>description = models.TextField(blank=True)
>owner = models.ForeignKey(User, related_name='owner_set')
>
> If I want to show the Calendars of the logged in user, I would have to
> itterate the calendar objects,
> getting the related appointments and from there the user.
>

I think this should work:

Calendar.objects.filter(appointment__owner = request.user)

Try it and see.

Malcolm

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Speed of search question

2011-07-06 Thread Benedict Verheyen
Hi,


I have these models (not really but it's to explain my question :))

class Calendar(models.Model):
name = models.CharField(max_length=60)
description = models.TextField(blank=True)
appointment = models.ManyToManyField(Appointment, 
related_name='appointment_set')

class Appointment(models.Model):
name = models.CharField(max_length=60)
description = models.TextField(blank=True)
owner = models.ForeignKey(User, related_name='owner_set')

If I want to show the Calendars of the logged in user, I would have to itterate 
the calendar objects,
getting the related appointments and from there the user.
If the users match, I know it's a calendar of the logged in user.

If the user has more than 1 calendar, this might really be a costly search.
I know this might not be a good usecase but it's to understand the cost of 
searching.

If I add a ForeignKey field to Calendar, the search seems a lot simpler.
However you're storing data that is known through the appointment relation.

With adding the extra Foreignkey field to Calendar, the search is simpler but 
is it also faster?

Can you test this with testsuite of Django?

Thanks for any info,
Benedict

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.