From: | Sachin Kumar <sachinkumaras(at)gmail(dot)com> |
---|---|
To: | pgsql-sql(at)lists(dot)postgresql(dot)org |
Subject: | PostgreSQL Django Query |
Date: | 2021-01-07 11:55:42 |
Message-ID: | CALg-PKD6g_aEA40kpqSLuUoJrZEZA3LWG=vY1+Eqrk5inqaaXQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Hi All,
I am using Python Django and PostgreSQL to build our report app.
I am using below mention query to find some details. the query mention
below is running fine in PostgreSQL command line and giving results in 2 sc
for 2 million cards but when I am trying the same in Django application it
is taking too much time and the web page is expired while running this
query.
can anyone help how to make the query faster in Django
rows = M_Assign.objects.raw(''' select C.id
<http://s.bl-1.com/h/dcktcHRZ?url=http://c.id/>,M."merchant_name",C."MERCHANT_ID",S."store_id"
Owning_Store_ID ,S."store_name" Owning_Store_Name,F."franchisee_name"
Owning_Group,C."ACCOUNT_NUMBER",C."STORE_ID",C."GIFT_LIST_REF" FROM
vdaccount_card_assign C INNER JOIN vd_merchant_master M ON
C."MERCHANT_ID"=M."merchant_id" AND C."MERCHANT_ID"='003561002966107' INNER
JOIN vd_store_master S ON S."store_id"=C."GIFT_LIST_REF" OR
C."GIFT_LIST_REF"='' INNER JOIN vd_franchisee F ON
S."franchisee_id"=F."franchisee_id" ''')
--
Best Regards,
Sachin Kumar
From | Date | Subject | |
---|---|---|---|
Next Message | Philip Semanchuk | 2021-01-07 13:58:56 | Re: how to make query |
Previous Message | Sachin Kumar | 2021-01-07 10:15:02 | how to make query |