SQLize
Online
/
PHPize Online
/
SQLtest Online
A
A
A
Share
Donate
Blog
Popular
Donate
A
A
A
Share
Blog
Popular
SQLize.online is a free online SQL environment for quickly running, experimenting with and sharing code.
You can run your SQL code on top of the most popular RDBMS including MySQL, MariaDB, SQLite, PostgreSQL, Oracle and Microsoft SQL Server.
SQL code:
Upload
Copy
Format
Clear
create table tst1 ( id bigint primary key, key text not null, value text not null ); insert into tst1 (id, key, value) select i, 'k'||i, 'v'||(i*7) from generate_series(1, 100000) g (i); create index idx_tst1_key on tst1 (key asc); vacuum analyze tst1; select pg_size_pretty(pg_indexes_size('tst1')); -- as expected: index scan explain (analyze, buffers) select id from tst1 where key = 'v111'; -- seq scan because this index can not work with `like` explain (analyze, buffers) select id from tst1 where key like 'v111%'; drop index idx_tst1_key; create index idx_tst1_key_c on tst1 (key collate "C" asc); select pg_size_pretty(pg_indexes_size('tst1')); -- now the index works explain (analyze, buffers) select id from tst1 where key like 'v111%'; -- but explain (analyze, buffers) select id from tst1 where key = 'v111'; -- haha, it does not work with equals drop index idx_tst1_key_c; create index idx_tst1_key_pattern on tst1 (key text_pattern_ops asc); select pg_size_pretty(pg_indexes_size('tst1')); -- now this works explain (analyze, buffers) select id from tst1 where key = 'v111'; -- and this works explain (analyze, buffers) select id from tst1 where key like 'v111%';
SQL
Server:
MariaDB 11.4
MariaDB 11.5
MariaDB 10
MariaDB 10 Sakila (ReadOnly)
MySQL 5.7
MySQL 5.7 Sakila (ReadOnly)
MySQL 8.0
MySQL 8.0 Sakila (ReadOnly)
SQLite 3
SQLite 3 Preloaded
PostgreSQL 10 Bookings (ReadOnly)
PostgreSQL 11
PostgreSQL 12
PostgreSQL 13
PostgreSQL 14
PostgreSQL 15
MS SQL Server 2017
MS SQL Server 2019
MS SQL Server 2022
MS SQL Server 2022 AdventureWorks (ReadOnly)
Firebird 4.0
Firebird 4.0 (Employee)
Oracle Database 19c (HR)
Oracle Database 21c
Oracle Database 23c Free
SOQOL
Version
ER Diagram
Preserve result
Stuck with a problem?
Got Error?
Ask ChatGPT!
Result:
Copy
Clear