Reputation: 43
I have one query which I ran on mysql, mssql or oracle like
select * from user
that query give me 0.5 million records/rows. I want to get only 10 rows. Below is python code :
cursor.execute(query)
columns = cursor.description
rows = cursor.fetchall()
I tried using cursor.fetchmany(10) and that condition is giving me 10 row but it takes a lot of time. I want to set a limit before executing the query so that it will be not take much time and also got fast execution. Please give me any solution in python. Please help me...
Upvotes: 2
Views: 2136