Python Forum
Sorting Data Returned From Database
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sorting Data Returned From Database
#8
Hi,

Firstly thank you again for your help, it's much appreciated.

These are the create statements for the two tables in the database ;

CREATE TABLE ingredient (
display_name varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
recipe_ids mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
id int NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=1726 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE recipe (
id int NOT NULL AUTO_INCREMENT,
name varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
different_ingredients int DEFAULT NULL,
picture_url varchar(300) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
rating float DEFAULT NULL,
rating_quantity int DEFAULT NULL,
method varchar(10000) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
servings varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=43276 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

~30,000 recipes does mean there would be potentially a lot of rows in a third recipe_ingredient table. E.g. say each recipe on average has 8 different ingredients, that's 240,000 rows. That might not sound like much, but I am also interested in making the API perform well under load/multiple users. I have a load testing tool for this so it is easy for me to test different strategies out.
Reply


Messages In This Thread
Sorting Data Returned From Database - by Timbo03 - Feb-11-2023, 03:33 PM
RE: Sorting Data Returned From Database - by Yoriz - Feb-11-2023, 03:50 PM
RE: Sorting Data Returned From Database - by Timbo03 - Feb-18-2023, 01:07 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  RE: Data isn't writing to the Database with Django and SQL Lite card51shor 15 5,397 Sep-16-2020, 08:27 AM
Last Post: metulburr
  Calling a Returned Value to Another Function valerydolce 9 6,789 Mar-28-2017, 09:54 PM
Last Post: valerydolce

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020