Questions tagged [limit]

Relates to any sort of limit applied to data or resources, e.g. limiting the size or value of a variable, limiting the rate of incoming traffic or CPU usage. [tag:sql-limit] should be used to refer to the LIMIT keyword in SQL.

Relates to any sort of limit applied to data or resources:

  • Limit a size of a database
  • Limit the admissable value of a variable
  • Limit to the rate of incoming traffic
  • Limit to CPU/reqource usage

Also relating to the mathematical notion of limit: the value that a sequence of numbers "approaches" as the sequence progresses.

Use for questions related to LIMIT keyword in SQL.

4370 questions
160
votes
6 answers

Is there a limit to the length of a GET request?

Is there a limit to the length of a GET request?
Javapolis
131
votes
10 answers

Laravel Eloquent limit and offset

This is mine $art = Article::where('id',$article)->firstOrFail(); $products = $art->products; I just wanna take a limit 'product' This is wrong way $products = $art->products->offset($offset*$limit)->take($limit)->get(); Please give me…
Sang Trần
  • 2,147
  • 4
  • 13
  • 20
106
votes
5 answers

Does adding 'LIMIT 1' to MySQL queries make them faster when you know there will only be 1 result?

When I add LIMIT 1 to a MySQL query, does it stop the search after it finds 1 result (thus making it faster) or does it still fetch all of the results and truncate at the end?
Logan Serman
  • 29,447
  • 27
  • 102
  • 141
105
votes
10 answers

MySQL - UPDATE query with LIMIT

I want to update rows in my table with starting from 1001 to next 1000. I tried with following query: UPDATE `oltp_db`.`users` SET p_id = 3 LIMIT 1001, 1000 This is giving me syntax error. Is this correct? am I doing any mistake here. Can we limit…
Rahul Shelke
  • 2,052
  • 4
  • 28
  • 50
103
votes
3 answers

Combining UNION and LIMIT operations in MySQL query

I have a Jobs and a Companies table, and I want to extract 20 jobs that meet the following criteria: Jobs only from two (2) named companies There can at most be 10 jobs per company I have tried the following SELECT with UNION DISTINCT, but the…
user172517
97
votes
12 answers

MySQL JOIN with LIMIT 1 on joined table

I want to join two tables, but only get 1 record of table2 per record on table1 For example: SELECT c.id, c.title, p.id AS product_id, p.title FROM categories AS c JOIN products AS p ON c.id = p.category_id This would get me all records in…
John Davidson
  • 973
  • 1
  • 6
  • 4
97
votes
10 answers

Equivalent of LIMIT for DB2

How do you do LIMIT in DB2 for iSeries? I have a table with more than 50,000 records and I want to return records 0 to 10,000, and records 10,000 to 20,000. I know in SQL you write LIMIT 0,10000 at the end of the query for 0 to 10,000 and LIMIT…
elcool
  • 6,041
  • 7
  • 29
  • 44
96
votes
3 answers

Max files per directory in S3

If I had a million images, would it be better to store them in some folder/sub-folder hierarchy or just dump them all straight into a bucket (without any folders)? Would dumping all the images into a hierarchy-less bucket slow down LIST…
Nikhil Gupte
  • 3,266
  • 4
  • 25
  • 15
90
votes
5 answers

How can I programmatically remove the 2 connection limit in WebClient

Those "fine" RFCs mandate from every RFC-client that they beware of not using more than 2 connections per host... Microsoft implemented this in WebClient. I know that it can be turned off with App.config:
Christian
  • 2,903
  • 4
  • 31
  • 34
89
votes
2 answers

Browser Javascript Stack size limit

I am getting some client-side Javascript stack overflow issues specifically in IE browser, this is happening inside a third party library that makes some function calls and for some reason they occasionally brake in IE only due to it's low stack…
guilhebl
  • 8,330
  • 10
  • 47
  • 66
87
votes
10 answers

Limit foreign key choices in select in an inline form in admin

The logic is of the model is: A Building has many Rooms A Room may be inside another Room (a closet, for instance--ForeignKey on 'self') A Room can only be inside another Room in the same building (this is the tricky part) Here's the code I…
mightyhal
  • 1,667
  • 1
  • 14
  • 8
84
votes
3 answers

Does MAX_PATH issue still exists in Windows 10

Can someone please tell us/me if the MAX_PATH issue still exists in (the technical preview of) Windows 10. And if it exists: How many characters can a path and an individual file name have?
dkeck
  • 1,072
  • 1
  • 8
  • 13
84
votes
13 answers

How to limit the number of dropzone.js files uploaded?

Depending on the use case, how do I constrain the number of files that dropzone.js will allow? For example, I might need to only allow 1, 2, or 4 files uploaded. It's not uploadMultiple. Unfortunately, uploadMultiple only applies to the number of…
pydanny
  • 7,954
  • 6
  • 34
  • 42
80
votes
4 answers

Is there a limit to the number of nested 'for' loops?

Since everything has a limit, I was wondering if there is a limit to the number of nested for loops or as long as I have memory, I can add them, can the Visual Studio compiler create such a program? Of course a 64 or more nested for loops would be…
Fred Smith
  • 2,047
  • 3
  • 25
  • 36
80
votes
2 answers

JPA 2 CriteriaQuery, using a limit

I am using JPA 2. For safety reasons, I am working type safe with CriteriaQuery's (and thus, I am not searching for any solutions to typed queries and so on). I recently came across an issue in which I needed to set a SQL-LIMIT. After a lot of…
Menno
  • 12,175
  • 14
  • 56
  • 88