Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
111 views

My query is taking too long to run when I use general filters, but it's fine with specific filters. I suspect it's an optimization issue. To fix it, I'm trying to create a non-clustered index on a new ...
nexus-4's user avatar
  • 13
104 votes
15 answers
233k views

I have statements like this that are timing out: DELETE FROM [table] WHERE [COL] IN ( '1', '2', '6', '12', '24', '7', '3', '5') I tried doing one at a time like this: DELETE FROM [table] WHERE [COL] ...
Kyle's user avatar
  • 34k
1 vote
1 answer
119 views

I'm designing a postgres database in which there is a table that has a jsonb type column. I would like this column to be unique. There is no need to have two objects with the exact same json ...
hasdrubal's user avatar
  • 1,168
-1 votes
1 answer
396 views

I have a parsed representation of an SQL query in the form of an abstract syntax tree. I'd like to convert it into an intermediate logical tree representation, which can in turn be expanded into ...
Kathandrax's user avatar
  • 1,054
-1 votes
2 answers
56 views

In order to store the country information for a person I did: CREATE TABLE test ( id INT IDENTITY(1, 1), name VARCHAR(100) NOT NULL, country VARCHAR(100) NOT NULL, ...
adragomir's user avatar
  • 659
0 votes
0 answers
438 views

I have the following SQL script to use for our Microsoft Dynamics NAV Database (MS SQL Server). It looks for missing indexes in the database. We have the problem that the script also finds some tables ...
disnamedyna's user avatar
1 vote
1 answer
4k views

I have a Woocommerce site with around 10K products but got a 5.1 GiB database size and post_meta only occupy 4.5 GiB but the wp_posts table is 350 MB only. I have tried the following query but still ...
Chandra Shekhar Pandey's user avatar
0 votes
3 answers
2k views

I have a table (innodb) with 1 million new inserts (20GB) a week. I only need the data for 1 week, so I delete it after 7 days, so each day we delete around 3GB and insert 3GB new. That table is ...
Developer Jano's user avatar
5 votes
1 answer
7k views

Though it may sound like a stupid question, sometimes it is necessary to show page numbers (and also the last page). What is the best way to calculate total row counts and also calculate page numbers (...
Sakibur Rahman's user avatar
0 votes
1 answer
218 views

The situation I am having is the following. I have a transactions database table. I have both an incremental id for each transaction as well as a unique ID to use for front-end purposes. An example ID ...
Mihail Minkov's user avatar
1 vote
1 answer
3k views

I'm migrating my Postgres database and am attempting to update a string value to a numeric value, like this: UPDATE table SET column = 1 WHERE LENGTH(column) = 1; This table contains around 20 ...
Californium's user avatar
1 vote
1 answer
2k views

and I appreciate in advance for your help on this. I have a VPS with the following specs: OS: Centos 7.x CPU Model: Common KVM processor CPU Details: 6 Core(2200 MHz) Distro Name: CentOS Linux ...
ALE TAU's user avatar
  • 23
1 vote
0 answers
30 views

In MySQL, it is possible to partition a table based on a timestamp column using the PARTITION BY RANGE clause in the CREATE TABLE statement. Can a similar approach be used in GridDB to partition a ...
Ammar Ubaid 's user avatar
1 vote
1 answer
137 views

I am using PostgreSQL 10 + pg_trgm extension. Table layout: Column | Type | Collation | Nullable | Default | Storage | --------------+-------------------+-----------+...
Xlv's user avatar
  • 55
0 votes
1 answer
253 views

In case of a JOIN, especially in a one to many relationship, the result set will very often contain a lot of duplicate information in the result. For example, TABLE_A_ID TABLE_A_FIELD_ONE ...
f.khantsis's user avatar
  • 3,610
3 votes
2 answers
22k views

To optimize magento we enable slow query log in mysql. What is ideal value for query_long_time especially for magento?
Sandesh's user avatar
  • 307
1 vote
1 answer
151 views

I currently have four tables that need to be joined with a left join. There are about 400_000 (400 thousand) of data records (which will grow in the future). In addition to the left join, the ...
lublak's user avatar
  • 45
0 votes
1 answer
911 views

I have an select query with about 1M records, I'm working on Magento 1.9 database. SELECT IF(sup_ap.is_percent = 1, TRUNCATE(mt.value + (mt.value * sup_ap.pricing_value / 100), 4), mt....
HoangHieu's user avatar
  • 2,840
15 votes
5 answers
9k views

I need to fit in additional data into a database, and I have a choice between modifying an existing table (table_existing) or creating new tables. This is how table_existing looks like right now: ...
siliconpi's user avatar
  • 8,325
0 votes
1 answer
501 views

I have a MySQL database. I have a table in it which has around 200000 rows. I am querying through this table to fetch the latest data.Query select * from `db`.`Data` where floor = "floor_value"...
chink's user avatar
  • 1,661
2 votes
3 answers
1k views

I'm learning how to optimize my database by re choosing the correct data types for the columns and I want to know how much size I will save if I choose MEDIUMINT (3 Bytes) instead of INT(4 Bytes) ...
Accountant م's user avatar
0 votes
1 answer
898 views

How can I filter queries by date to prevent massive sequential scan on a large database? My survey app collects responses and each answer to a question in a survey is stored in a table ...
Jordan's user avatar
  • 4,933
-1 votes
3 answers
108 views

I'm working on a project for university. Do you guys know what kind of algorithms i could implement that would help with the proper design and general performance of a database? Until now i came up ...
Olteanu Radu's user avatar
0 votes
2 answers
67 views

Which is preferred for mapping values: reusing mapping functions OR building reference tables to do lookups? This is a very general high-level question, which, I believe is mostly language-independent....
Jayden.Cameron's user avatar
0 votes
1 answer
827 views

I'm trying to identify some performance bottlenecks in my Postgres queries and ran an EXPLAIN ANALYZE on a query to get some insights. The output of the query analysis is below: Nested Loop (...
TheMethod's user avatar
  • 2,998

1
2 3 4 5