- My goal: My goal for my database is I have several .csv files uploaded in the backend. I have a query that “grabs” them and displays them on a list box. when I select a csv file name from the list box, it is then displayed in a table.
- Issue: When I select about 4 different .csv files to view in the table to test, it times out on the 5th try. I am so confused because sometimes it let’s me select 10+ .csv files and other times, it timesout on the second try.
-
Steps I've taken to troubleshoot: I have updated my queries:
this query is to grab the file names:
SELECT DISTINCT file_name
FROM manufacturing_csv_uploads-- if you have this column
LIMIT 50; -- adjust based on expected volumeand this query is to upload to the table what ever file name is selected with the list box selected value
SELECT _id, start_time, end_time, test_version, pcb_id, file_name
FROM retool_csv_view
WHERE file_name = {{ recordcsv.value }}
LIMIT {{ manufacturing_csv_view.pageSize }}
OFFSET {{ manufacturing_csv_view.pageSize * manufacturing_csv_view.pageNumber }}I also have a script in an event handler in the table as well
csvData.setValue(); // clears the table first
if (!getCsvRecords.isFetching && recordcsv.value) {
getCsvRecords.trigger({
additionalScope: {
fileName: recordcsv.value,
},
onSuccess: (data) => {
csvData.setValue(data); // show data only after it's ready
console.log("
Loaded:", recordcsv.value);
},
onFailure: (err) => {
console.error("
Load failed", err);
}
});
} else {
console.warn("
Skipped trigger: still fetching or no value selected");
} - Additional info: (Cloud or Self-hosted, Screenshots) - I am using postgresql in a virtual machine and my retool app is on my standartd browser.
Does anyone have any issues with queries timing out unexpectedly?
