Query Timeout after the 5th selection

  1. 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.
  2. 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.
  3. 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 volume

    and 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(":white_check_mark: Loaded:", recordcsv.value);
    },
    onFailure: (err) => {
    console.error(":cross_mark: Load failed", err);
    }
    });
    } else {
    console.warn(":hourglass_not_done: Skipped trigger: still fetching or no value selected");
    }

  4. 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?

Hey @hannah_b - thanks for reaching out. :slightly_smiling_face: Can you explain your setup in a little more detail? It's unclear whether you're running a self-hosted or Cloud instance and whether your database is hosted locally or in a cloud server.

Also - I don't think it's related, but we do recommend upgrading to the newer version of the table component! It looks like you're using the original version that has technically been deprecated.

Hi Darren,

I am using the Cloud instance. Is there any way I can check for updates? besides frequent timeouts, I can’t really tell if things need to be updated.

Hey! A quick question—approximately how many rows do those CSV files have?
If they're large, that could explain why queries start timing out after a few loads.

Also, have you tried loading the table with pagination instead of fetching the entire dataset at once? That usually helps a lot with performance, especially when you're repeatedly switching between files.

One more thing: the SQL query you're using currently forces the database to scan the entire table to match the selected file name. If the dataset is large and file is not indexed, this will slow down quickly—which explains the inconsistent timeouts.