Overview

The oxla_home_files virtual table lists all files associated with a specific table in the oxla home directory. This approach offers a more reliable way to retrieve data than simply scanning files directly.

Fields

FieldContentType
pathAbsolute path from the oxla working directoryTEXT
byte_sizeSize of the file in bytesBIGINT
start_indexFirst index in the file, if applicableNULLABLE TEXT
end_indexLast index in the file, if applicableNULLABLE TEXT
row_countNumber of rows in the fileBIGINT
batch_countNumber of batches the file is divided intoBIGINT
table_idID of the related tableBIGINT
namespace_idID of the related namespaceBIGINT
database_idID of the related databaseBIGINT

Example Query

This example shows how to query the oxla_home_files table in an Oxla instance.

Scenario 1: Empty Result

  1. Run the oxla_home_files query below.
SELECT * FROM oxla_internal.oxla_home_files;
  1. When the oxla_home_files table is empty, the query returns an empty result set.
 path | byte_size | start_index | end_index | row_count | batch_count | table_id | namespace_id | database_id 
------+-----------+-------------+-----------+-----------+-------------+----------+--------------+-------------
(0 rows)

Scenario 2: After Data Insertion

  1. Create and insert data to the table.
CREATE TABLE orders (
  order_id INT,
  order_date DATE,
  total_amount INT,
  shipping_address TEXT,
  status TEXT
);

INSERT INTO orders 
    (order_id, order_date, total_amount, shipping_address, status) 
VALUES 
    (1001, '2024-07-13', 150.75, '123 Main St, Anytown, USA', 'Shipped'),
    (1002, '2024-07-12', 200.50, '456 Elm St, Othertown, USA', 'Delivered'),
    (1003, '2024-07-12', 350.25, '789 Oak St, Anotherplace, USA', 'Processing'),
    (1001, '2024-07-11', 100.00, '321 Pine St, Somewhere, USA', 'Cancelled'),
    (1004, '2024-07-10', 500.00, '555 Maple St, Nowhere, USA', 'Pending');
  1. Run the oxla_home_files query below.
SELECT * FROM oxla_internal.oxla_home_files;
  1. After inserting data into the table, the query lists the file metadata stored in Oxla.
                                                                                          path                                                                                          | byte_size | start_index | end_index | row_count | batch_count | table_id | namespace_id | database_id 
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+-------------+-----------+-----------+-------------+----------+--------------+-------------
 s3://regional-providers-eu-central-1-dp/production/2jyd1o7D6CBCKyU2gWafDfEawmP/oxla_data/hack_on_oxla_non_empty_storage/0/0/16385/buffers/cluster-2jyd1jzvhgequov20igkxe4peyl-oxla-0/0 |       978 |             |           |         5 |           1 |    16385 |            0 |           0
(1 row)