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 result in 2 sc 
for 2 million cards but when i i am try the same in Django application it 
is taking too much of time and the web page is expired while running this 
query.

can anyone help how to make query faster in Django 

rows = M_Assign.objects.raw(''' select C.id 
<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" ''')  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4a0669b5-5417-484d-b66d-c25dd83d2ebfn%40googlegroups.com.

Reply via email to