1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] SQL using Python - fetch speed issue

Discussão em 'Python' iniciado por Stack, Setembro 12, 2024.

  1. Stack

    Stack Membro Participativo

    I'm attempting to run a SQL query to select two columns from a table. The issue comes when I use the cursor.fetchall() method, which takes 0.2 seconds to return the columns when in other similar cases it takes <0.01 seconds. The returned list is only 1-5 tuples long, so isn't an extreme amount of data.

    cursor.execute(f"SELECT Subject, Code FROM blockPeriodsTable WHERE dataIndex={num} AND Block='A'")
    blockPeriodsTemp = cursor.fetchall()


    Is there a way to speed this up or is it not possible?

    Continue reading...

Compartilhe esta Página