Re: Would old version of mysql caused performance issue in Django

2017-07-18 Thread Kevin Yu
elli de Andrade < > fbrua...@gmail.com > wrote: > >> It seems like some thing in your app view. >> >> Did you try to dump real database and run localy in your workstation? >> >> 2017-07-18 16:05 GMT-03:00 Kevin Yu >: >> >>> >>> <h

Re: Would old version of mysql caused performance issue in Django

2017-07-18 Thread Kevin Yu
nd run localy in your workstation? 2017-07-18 16:05 GMT-03:00 Kevin Yu : > > <https://lh3.googleusercontent.com/-jIXPWhwHNUw/WW5biPCMzlI/De4/BnmWrwpKd88NFW-PswfbXcBNZSN04c36ACLcBGAs/s1600/Screenshot%2Bfrom%2B2017-07-18%2B12-03-18.png> > > I even noticed when i do runser

Re: Would old version of mysql caused performance issue in Django

2017-07-18 Thread Kevin Yu
ting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. On Tuesday, July 18, 2017 at 11:43:53 AM UTC-7, Felipe wrote: > > Try to debug in chrome just press F12 and go to network tab and see > the times fot load content > > 2017-07-18 15:18 GMT-03:00 Kevin

Re: Would old version of mysql caused performance issue in Django

2017-07-18 Thread Kevin Yu
I've eliminated the possibility of mysql performance issue by directly running the query on the database. It's not network issue either since my ping is just fine. On Tuesday, July 18, 2017 at 11:00:58 AM UTC-7, Kevin Yu wrote: > > Hi All, > > I'm rewritting an w

Re: Would old version of mysql caused performance issue in Django

2017-07-18 Thread Kevin Yu
roment, probably is your network. > > 2017-07-18 15:00 GMT-03:00 Kevin Yu >: > >> Hi All, >> >> I'm rewritting an web application using Django 1.11. When i hooked up to >> my test mysql database (version 5.7), the performance is amazing. The page >> re

Would old version of mysql caused performance issue in Django

2017-07-18 Thread Kevin Yu
Hi All, I'm rewritting an web application using Django 1.11. When i hooked up to my test mysql database (version 5.7), the performance is amazing. The page renders within 1 second. However, when I connect to the existing production mysql (version 5.1), the page takes more than 10 seconds. I

Re: Need help for defining foreign key based on value from another table

2017-06-21 Thread Kevin Yu
, June 21, 2017 at 2:49:40 PM UTC-7, Kevin Yu wrote: > > I'm working with a legacy database so I have to set managed=False in the > model. Here's the 3 related tables: > > > class Branches(models.Model): > name = models.CharField(max_length=128) >

Need help for defining foreign key based on value from another table

2017-06-21 Thread Kevin Yu
I'm working with a legacy database so I have to set managed=False in the model. Here's the 3 related tables: class Branches(models.Model): name = models.CharField(max_length=128) branchpoint_str = models.CharField(max_length=255) dev_lead_id = models.IntegerField(blank=True, null=Tru

Re: Raw SQL - How to approach paging and lazy fetching

2017-06-21 Thread Kevin Yu
egacy database. When defining fkey > you need to point it to corresponding field in fkey attributes in your > model if it isnt your target model pk. > > And you can join nonmanged models with managed just fine. > > 16.6.2017 19.26 "Kevin Yu" > kirjoitti: > > Hi Ja

Re: Raw SQL - How to approach paging and lazy fetching

2017-06-16 Thread Kevin Yu
> leverage full power of ORM [1]. > > Just create models and in their Meta set managed = False and there you go. > > And what comes to paging - you need to somehow pass offset and limit to > your query. > > [1] https://docs.djangoproject.com/en/1.11/howto/legacy-databases/ > &

Raw SQL - How to approach paging and lazy fetching

2017-06-15 Thread Kevin Yu
Hi All, I am using raw sql to connect to database. The reason we used raw sql instead of the Django model is because the database is legacy and is being shared by multiple applications... I have one use case that I'm struggling right now. Basically I have a page that fetch more than 1000 resul