[CONPY-227] Replace collections.named_tuple by PyStruct_Sequence (C-Python) Created: 2022-10-09  Updated: 2023-01-23  Resolved: 2023-01-23

Status: Closed
Project: MariaDB Connector/Python
Component/s: DBAPI 2.0
Affects Version/s: 1.1.4
Fix Version/s: 1.1.5

Type: Bug Priority: Major
Reporter: Georg Richter Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None

Python Version: 3.10

 Description   

The used named_tuple class from collections module is

  • too slow
  • consumes too much memory

How to repeat:

import mariadb
 
connection= mariadb.connect(db="test")
cursor= connection.cursor(named_tuple=True)
for in range(1,1000):
    cursor.execute("SELECT seq FROM seq_1_to_10000")
    rows= cursor.fetchall()

Output:

georg@beethoven:~/work/python/test$ python3.10 test_conpy227.py
Killed

Same behavior when running this script with MySQL Connector/Python, which also uses collections.named_tuple.



 Comments   
Comment by Georg Richter [ 2023-01-23 ]

Fixed in 1.1.5

Generated at Thu Feb 08 03:31:12 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.