How long will my SQL query take?

I have a database in SQLite Administrator, with 3 tables, for example A, B and C.

Table A contains 3 columns p1, p2, and p3 containing about 2 million rows.
Table B contains 2 columns p1 and p4, also about 2 million rows.
Table C has 1 column p4 with approximately 800,000 rows.

The query I'm trying to run is as follows:

SELECT A.p1, B.p4, A.p2, A.p3
FROM A,B,C
WHERE A.p1=B.p1 AND B.p4=C.p4

The request has already taken 3 days and still has not finished. I wonder if I have to interrupt it or wait for it to complete. If it ends in the next 5-6 days, I will probably wait, but if it takes longer, I will have to cancel it.

Should I wait or not?

My PC specifications: Core 2 Duo 1.86 GHz, 2 GB RAM,

+3
2

, 3 ( ).

A, B, C, A x B x C. x B x C

SELECT COUNT(*)
FROM A,B,C

(2*10^6) * (2*10^6) * (0.8*10^6) = 3.2 * 10^18

, where , 3,2 * 10 ^ 9 . 101 .

, p1 p4, RDBMS (, , , , ).

+2

A.p1, B.p1, B.p4, C.p4? , , .

- . Lite. .

0

Source: https://habr.com/ru/post/1753124/


All Articles